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

53.26. pg_index #

The catalog <structname>pg_index</structname> contains part of the information about indexes. The rest is mostly in <link linkend="catalog-pg-class"><structname>pg_class</structname></link>. pg_indexカタログはインデックス情報の一部を保持します。 その他のほとんどの情報はpg_classにあります。

表53.26 pg_indexの列

<title><structname>pg_index</structname> Columns</title>

Column Type 列 型

Description 説明

indexrelid oid (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>) (参照先 pg_class.oid

The OID of the <link linkend="catalog-pg-class"><structname>pg_class</structname></link> entry for this index このインデックスに対するpg_class項目のOID

indrelid oid (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>) (参照先 pg_class.oid

The OID of the <link linkend="catalog-pg-class"><structname>pg_class</structname></link> entry for the table this index is for このインデックスが使われるテーブルに対するpg_class項目のOID

indnatts int2

The total number of columns in the index (duplicates <literal>pg_class.relnatts</literal>); this number includes both key and included attributes インデックス内の列数(pg_class.relnattsの複製)

indnkeyatts int2

The number of <firstterm>key columns</firstterm> in the index, not counting any <firstterm>included columns</firstterm>, which are merely stored and do not participate in the index semantics 格納されているだけで、インデックスのセマンティクスに寄与していないincluded columnsを含まないインデックス内のkey columnsの数。

indisunique bool

If true, this is a unique index trueの場合、一意性インデックス

indnullsnotdistinct bool

This value is only used for unique indexes. If false, this unique index will consider null values distinct (so the index can contain multiple null values in a column, the default PostgreSQL behavior). If it is true, it will consider null values to be equal (so the index can only contain one null value in a column). この値はユニークインデックスに対してのみ使用されます。 falseの場合は、このユニークインデックスはNULL値を区別するものとみなします(PostgreSQLのデフォルト動作では、インデックスはカラムに複数のNULL値を含むことができます)。 NULL値は等しいものとみなします場合はtrue(インデックスはカラムに1つのNULL値しか含むことができません)。

indisprimary bool

If true, this index represents the primary key of the table (<structfield>indisunique</structfield> should always be true when this is true) trueの場合、このインデックスはテーブルの主キーを表します (この値がtrueの場合、indisuniqueは常にtrueでなければなりません)

indisexclusion bool

If true, this index supports an exclusion constraint trueの場合、このインデックスは排他制約をサポートします

indimmediate bool

If true, the uniqueness check is enforced immediately on insertion (irrelevant if <structfield>indisunique</structfield> is not true) trueの場合、一意性検査が挿入時即座に強制されます (indisuniqueがtrueでなければ無関係です)

indisclustered bool

If true, the table was last clustered on this index trueの場合、前回このインデックスを元にテーブルはクラスタ化されました

indisvalid bool

If true, the index is currently valid for queries. False means the index is possibly incomplete: it must still be modified by <link linkend="sql-insert"><command>INSERT</command></link>/<link linkend="sql-update"><command>UPDATE</command></link> operations, but it cannot safely be used for queries. If it is unique, the uniqueness property is not guaranteed true either. trueの場合、現在このインデックスは問い合わせに対して有効です。 falseの場合は、インデックスが不完全かもしれないことを意味します。 INSERT/UPDATE操作による変更が行われているはずで、問い合わせに使用するには安全ではありません。 一意性インデックスであれば、一意性も保証されません。

indcheckxmin bool

If true, queries must not use the index until the <structfield>xmin</structfield> of this <structname>pg_index</structname> row is below their <symbol>TransactionXmin</symbol> event horizon, because the table may contain broken <link linkend="storage-hot">HOT chains</link> with incompatible rows that they can see trueの場合、pg_index行のxminTransactionXminイベント境界値を下回るまで、問い合わせはインデックスを使用してはいけません。 なぜなら、テーブルは互換性の無い行と共に破壊されたHOTチェインを含み、それらが可視であるかもしれないからです。

indisready bool

If true, the index is currently ready for inserts. False means the index must be ignored by <link linkend="sql-insert"><command>INSERT</command></link>/<link linkend="sql-update"><command>UPDATE</command></link> operations. trueの場合、インデックスは挿入に対する準備ができています。 falseの場合、インデックスはINSERT/UPDATE操作により無視されなければならないことを意味します。

indislive bool

If false, the index is in process of being dropped, and should be ignored for all purposes (including HOT-safety decisions) falseの場合は、インデックスの削除処理が進行中であり、このためすべての目的において(HOT安全性の決定を含む)無視しなければなりません

indisreplident bool

If true this index has been chosen as <quote>replica identity</quote> using <link linkend="sql-altertable-replica-identity"><command>ALTER TABLE ... REPLICA IDENTITY USING INDEX ...</command></link> trueの場合、このインデックスはALTER TABLE ... REPLICA IDENTITY USING INDEX ...を用いてreplica identityが選択されます

indkey int2vector (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>) (参照先 pg_attribute.attnum

This is an array of <structfield>indnatts</structfield> values that indicate which table columns this index indexes. For example, a value of <literal>1 3</literal> would mean that the first and the third table columns make up the index entries. Key columns come before non-key (included) columns. A zero in this array indicates that the corresponding index attribute is an expression over the table columns, rather than a simple column reference. このインデックスがどのテーブル列をインデックスとしているかを示すindnatts配列の値です。 例えば、1 3は1番目と3番目のテーブル列がインデックス項目となっていることを示します。 キー列は、(INCLUDE句で指定した)非キー列の前に来ます。 この配列でゼロとなっているのは対応するインデックスの属性が単純な列参照ではなくテーブル列に渡った演算式であることを示します。

indcollation oidvector (references <link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.<structfield>oid</structfield>) (参照先 pg_collation.oid

For each column in the index key (<structfield>indnkeyatts</structfield> values), this contains the OID of the collation to use for the index, or zero if the column is not of a collatable data type. インデックスキー(indnkeyattsの値)内の各列に関してここにはインデックスで使用される照合順序のOIDが含まれます。 照合できないデータ型の列ではゼロが入ります。

indclass oidvector (references <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.<structfield>oid</structfield>) (参照先 pg_opclass.oid

For each column in the index key (<structfield>indnkeyatts</structfield> values), this contains the OID of the operator class to use. See <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details. インデックスキー(indnkeyattsの値)内のそれぞれの列に対して、使用する演算子クラスのOIDを保持します。 pg_opclassを参照してください。

indoption int2vector

This is an array of <structfield>indnkeyatts</structfield> values that store per-column flag bits. The meaning of the bits is defined by the index's access method. 列毎のフラグビットを格納するindnkeyatts値の配列です。 ビットの意味はインデックスのアクセスメソッドによって定義されています。

indexprs pg_node_tree

Expression trees (in <function>nodeToString()</function> representation) for index attributes that are not simple column references. This is a list with one element for each zero entry in <structfield>indkey</structfield>. Null if all index attributes are simple references. 単純な列参照でないインデックス属性の(nodeToString()表現による)演算式ツリー。 indkeyがゼロの各エントリについて1つの要素があるリストになっています。 すべてのインデックス属性が単純な参照ならNULLとなります。

indpred pg_node_tree

Expression tree (in <function>nodeToString()</function> representation) for partial index predicate. Null if not a partial index. 部分インデックス属性の(nodeToString()表現による)演算式ツリー。 部分インデックスでなければNULL。