バージョンごとのドキュメント一覧

53.4. pg_amop #

The catalog <structname>pg_amop</structname> stores information about operators associated with access method operator families. There is one row for each operator that is a member of an operator family. A family member can be either a <firstterm>search</firstterm> operator or an <firstterm>ordering</firstterm> operator. An operator can appear in more than one family, but cannot appear in more than one search position nor more than one ordering position within a family. (It is allowed, though unlikely, for an operator to be used for both search and ordering purposes.) pg_amopカタログにはアクセスメソッド演算子の集合に関連付けられた演算子の情報が格納されています。 演算子族のメンバである演算子毎に1つの行が存在します。 演算子族のメンバは検索演算子または順序付け演算子のいずれかになることができます。 演算子は1つ以上の演算子族に現れますが、演算子族の中では検索でも順序付けでも複数現れることはありません。 (ほとんどありませんが、ある演算子が検索目的と順序付け目的の両方で使用されることが許されます。)

表53.4 pg_amopの列

<title><structname>pg_amop</structname> Columns</title>

Column Type 列 型

Description 説明

oid oid

Row identifier 行識別子

amopfamily oid (references <link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.<structfield>oid</structfield>) (参照先 pg_opfamily.oid

The operator family this entry is for この項目用の演算子族

amoplefttype oid (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

Left-hand input data type of operator 演算子の左辺側のデータ型

amoprighttype oid (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

Right-hand input data type of operator 演算子の右辺側のデータ型

amopstrategy int2

Operator strategy number 演算子の戦略番号

amoppurpose char

Operator purpose, either <literal>s</literal> for search or <literal>o</literal> for ordering 演算子の目的。 s = 検索用、 o = 順序付け用

amopopr oid (references <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>) (参照先 pg_operator.oid

OID of the operator 演算子のOID

amopmethod oid (references <link linkend="catalog-pg-am"><structname>pg_am</structname></link>.<structfield>oid</structfield>) (参照先 pg_am.oid

Index access method operator family is for 演算子族用のインデックスアクセスメソッド

amopsortfamily oid (references <link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.<structfield>oid</structfield>) (参照先 pg_opfamily.oid

The B-tree operator family this entry sorts according to, if an ordering operator; zero if a search operator 順序付け用の演算子の場合、この項目のソートが従うB-tree演算子族。検索用演算子であればゼロ


A <quote>search</quote> operator entry indicates that an index of this operator family can be searched to find all rows satisfying <literal>WHERE</literal> <replaceable>indexed_column</replaceable> <replaceable>operator</replaceable> <replaceable>constant</replaceable>. Obviously, such an operator must return <type>boolean</type>, and its left-hand input type must match the index's column data type. 検索用演算子の項目は、この演算子族のインデックスをWHERE indexed_column operator constantを満たすすべての行を見つけるための検索に使用できることを示します。 いうまでもありませんが、こうした演算子は論理型を返さなければならず、また左辺の入力型はインデックス列のデータ型に一致しなければなりません。

An <quote>ordering</quote> operator entry indicates that an index of this operator family can be scanned to return rows in the order represented by <literal>ORDER BY</literal> <replaceable>indexed_column</replaceable> <replaceable>operator</replaceable> <replaceable>constant</replaceable>. Such an operator could return any sortable data type, though again its left-hand input type must match the index's column data type. The exact semantics of the <literal>ORDER BY</literal> are specified by the <structfield>amopsortfamily</structfield> column, which must reference a B-tree operator family for the operator's result type. 順序付け用演算子の項目は、この演算子族のインデックスをORDER BY indexed_column operator constantで表される順序で行を返すためのスキャンに使用できることを示します。 こうした演算子の左辺の入力型はインデックス列のデータ型に一致しなければならないことは同じですが、任意のソート可能なデータ型を返すことができます。 ORDER BYの正確な意味は、この演算子の結果型用のB-tree演算子族を参照する必要があるamopsortfamily列により指定されます。

注記

At present, it's assumed that the sort order for an ordering operator is the default for the referenced operator family, i.e., <literal>ASC NULLS LAST</literal>. This might someday be relaxed by adding additional columns to specify sort options explicitly. 現在、順序付け演算子のソート順は参照される演算子族のデフォルト、つまりASC NULLS LASTであると仮定されています。 これは将来、ソートオプションを明示的に指定する追加列を加えることで緩和されるかもしれません。

An entry's <structfield>amopmethod</structfield> must match the <structfield>opfmethod</structfield> of its containing operator family (including <structfield>amopmethod</structfield> here is an intentional denormalization of the catalog structure for performance reasons). Also, <structfield>amoplefttype</structfield> and <structfield>amoprighttype</structfield> must match the <structfield>oprleft</structfield> and <structfield>oprright</structfield> fields of the referenced <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link> entry. 項目のamopmethodは、項目を含む演算子族のopfmethodに一致しなくてはいけません(ここでのamopmethodは、性能上の理由からカタログ構造を意図的に非正規化したものも含みます)。 また、amoplefttypeamoprighttypeは、参照されているpg_operator項目のoprleftoprrightに一致しなくてはいけません。