doc-exports/docs/dws/dev/dws_04_0594.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

151 lines
16 KiB
HTML

<a name="EN-US_TOPIC_0000001233761785"></a><a name="EN-US_TOPIC_0000001233761785"></a>
<h1 class="topictitle1">PG_INDEX</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233761785__a7b89e3c3f0854d45bcb98f7b60cbf1ec"><strong id="EN-US_TOPIC_0000001233761785__b215523110101">PG_INDEX</strong> records part of the information about indexes. The rest is mostly in <strong id="EN-US_TOPIC_0000001233761785__b62014777181338">PG_CLASS</strong>.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233761785__t7af709b6266d4960a5114126520fbeb5" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PG_INDEX columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233761785__r3f94148faad142e08ee5d44be4673689"><th align="left" class="cellrowborder" valign="top" width="25.77%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001233761785__aa17fe4d6b6004788963e564bec072cff"><strong id="EN-US_TOPIC_0000001233761785__b84235270691445">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.73%" id="mcps1.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001233761785__ac7992ff090a44788a61f48a432c72c7c">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.49999999999999%" id="mcps1.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001233761785__aa4039ca5b00c4f72bbf878a2823f7437">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233761785__ra0d8691c0ed143e398de717ad45591ac"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__adf7d7fb90b9d4f86ac4b82eebb99d52d">indexrelid</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a59a22ac711574e0eb78b221a70ea1d6d">oid</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a70c009e843314caaa06941e34f6f378f">OID of the <strong id="EN-US_TOPIC_0000001233761785__b173931241163116">pg_class</strong> entry for this index</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r8ea706c421b24e158ed6aceffc6800e8"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a83c9c631f77f492e9c24db523c88a5b9">indrelid</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__af0b9940a3ae94ebca04eb9e6bfd6cab5">oid</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__acec08bf2b9cd455083e3d6a03dbdcb25">OID of the <strong id="EN-US_TOPIC_0000001233761785__b15927125193114">pg_class</strong> entry for the table this index is for</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r4f3c8f263b50435e802f7a5fc9266ca0"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a024d71be9244415ba6eec56feacd31e5">indnatts</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__abefc5a0265044875a21e3866a867abda">smallint</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a5a1ff57aa2e64acc98a23fad583162da">Number of columns in an index</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r18a07da2d52e4d8aa5872cf65e4ad559"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__afc72d54dda6741b39c3fdaa965e027db">indisunique</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__abcdf663bfdd64e32aaa2b100ba72225c"><span id="EN-US_TOPIC_0000001233761785__text116873515365">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__ad1b0ece4f9a34932a71d21933f40bbc5">This index is a unique index if the value is <strong id="EN-US_TOPIC_0000001233761785__b172451043191618">true</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r2a3aa621e9f144988fd4a70098b9621e"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a9b126ee9073644a28474aca2b600b126">indisprimary</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__af38534d9a1d74afd86777b40ef827865"><span id="EN-US_TOPIC_0000001233761785__text27764615369">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a49b6b04613a74129aeb8099e3f82c3f1">This index represents the primary key of the table if the value is <strong id="EN-US_TOPIC_0000001233761785__b1985662531611">true</strong>. If this value is <strong id="EN-US_TOPIC_0000001233761785__b14869568348">true</strong>, the value of <strong id="EN-US_TOPIC_0000001233761785__b58085160349">indisunique</strong> is true.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r0e119239ff314444b1d47541d0b96a6f"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a389c83910e0a404f9e8d36f746d4427c">indisexclusion</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__ada5abd916a27493ea16cc5f52d17d016"><span id="EN-US_TOPIC_0000001233761785__text3764127163615">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__ab21f30f4e8354d49b5d2110793dbfc0f">This index supports exclusion constraints if the value is <strong>true</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r2b3bb30d4843418ab55994b99c995138"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a3ce6b646dd6d4170abe37e79fb68e15b">indimmediate</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a84a26e742f58473db618c642b11abcce"><span id="EN-US_TOPIC_0000001233761785__text96471893616">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a609a8c63d8ea413e9db9c9d06a0c730c">A uniqueness check is performed upon data insertion if the value is <strong id="EN-US_TOPIC_0000001233761785__b23832061716">true</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r1f46dab8cf2a4e97acd4bdc6fa2c9cd4"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a347f024db2b749458e13ccb8a540a417">indisclustered</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a554b5966cea742819cd4d2e6c88e2032"><span id="EN-US_TOPIC_0000001233761785__text2589149153612">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a06cf9ccfae454b32b77a7ce021ee22d5">The table was last clustered on this index if the value is <strong id="EN-US_TOPIC_0000001233761785__b1036117540350">true</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__rc6348bcd7acc4d29845fa67ee8e37f59"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a0fc34c27b23545f9ab5a45d48aab702a">indisusable</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a4fb14a0170e64e83afdf93e1750b5b28"><span id="EN-US_TOPIC_0000001233761785__text113382010163612">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a7805de7fd37c48d397053495202e9866">This index supports insert/select if the value is <strong id="EN-US_TOPIC_0000001233761785__b15381183461715">true</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r309b559c0ae64c26958f5c80af72d518"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__ad6673213a5024f4f9d5388ba200471c2">indisvalid</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__af9015893664f4adf88207305922afa21"><span id="EN-US_TOPIC_0000001233761785__text12184611173616">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__aa6a1f16e8a9e416db31e9f9dbca665ce">This index is valid for queries if the value is <strong id="EN-US_TOPIC_0000001233761785__b135004091917">true</strong>. If this column is <strong id="EN-US_TOPIC_0000001233761785__b84235270620740">false</strong>, this index is possibly incomplete and must still be modified by <strong id="EN-US_TOPIC_0000001233761785__b17555161111220">INSERT/UPDATE</strong> operations, but it cannot safely be used for queries. If it is a unique index, the uniqueness property is also not true.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__rbdcfacca82734038bdf6ba3ef312dbf4"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a2050542e780e4ff59d6804e406efa09b">indcheckxmin</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__aee60493336a44c7fad7621bcc9527d6a"><span id="EN-US_TOPIC_0000001233761785__text116218129364">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__ad553206150d24f719aea4de78e77f22c">If the value is <strong id="EN-US_TOPIC_0000001233761785__b842352706114022">true</strong>, queries must not use the index until the xmin of this row in <strong id="EN-US_TOPIC_0000001233761785__b842352706113946">pg_index</strong> is below their <strong id="EN-US_TOPIC_0000001233761785__b84235270611402">TransactionXmin</strong> event horizon, because the table may contain broken HOT chains with incompatible rows that they can see.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r190331e72a0d455080964c1bc640f4ef"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__ae21a0732d56d44e6a43d992c375c00c7">indisready</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a4aa707c592ce4520891f34860bfe3f67"><span id="EN-US_TOPIC_0000001233761785__text12903171353611">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a9a97fb97e0144b61b65ecc5f9c3b2820">If the value is <strong id="EN-US_TOPIC_0000001233761785__b20101113110517">true</strong>, this index is ready for inserts. If the value is <strong id="EN-US_TOPIC_0000001233761785__b56995152570">false</strong>, this index is ignored when data is inserted or modified.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__rfab690a4f0a546e1aa5702583e80d20c"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a0d0b291a7a8149f59f7a18c25932876e">indkey</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__aa8143751a1c44632868d732bfc9415f8">int2vector</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__ad083d69843d2445dbf938d97fe84c1ad">This is an array of <strong id="EN-US_TOPIC_0000001233761785__b4218395577">indnatts</strong> values that indicate which table columns this index creates. For example, a value of <strong id="EN-US_TOPIC_0000001233761785__b343534019594">1 3</strong> means that the first and the third columns make up the index key. <strong id="EN-US_TOPIC_0000001233761785__b84235270620752">0</strong> in this array indicates that the corresponding index attribute is an expression over the table columns, rather than a simple column reference.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r316e98e08d704a20a8653457ef4202c3"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a47da82cdb1274d138aea5bc4a8d036b1">indcollation</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a8434921d19e649d8a4871e18d47a7742">oidvector</p>
<p id="EN-US_TOPIC_0000001233761785__a957b9cb4faaa4ecf965f8b11badc0292"></p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a114051e71acf446581dedd8d4c5e915b">ID of each column used by the index</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__ra00611416d174ed4aadc51a173f9d95c"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__ad2a042e2ede44780bb46ca029108d514">indclass</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a993d9494c4ed40a9bc4f56f324e96a52">oidvector</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a39ab128ec8224687a7694e4f5a0bd319">For each column in the index key, this column contains the OID of the operator class to use. For details, see <a href="dws_04_0603.html">PG_OPCLASS</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__ra8accc3673f544fd965434411f35bbc4"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a3caee67329f74f6bb965abb89f2a713a">indoption</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__ac0455da7964843ffb303db9a6a83d6dc">int2vector</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__ab5403f25467849a0ab1f7205f2e81e54">Array of values that store per-column flag bits. The meaning of the bits is defined by the index's access method.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__r63a9f8a4383b4b83a029bf2c3a6b03d5"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__a47b4daace62d4e5d834be23edc7193ea">indexprs</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a7d1d6f15cbcf4a82a3f38c9f21a9854b">pg_node_tree</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a4be7153c4cf14175a84ce5dfb231baf5">Expression trees (in <strong>nodeToString()</strong> representation) for index attributes that are not simple column references. It is a list with one element for each zero entry in <strong>INDKEY</strong>. NULL if all index attributes are simple references.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233761785__ra3d795fb748e42caa157264ff8155230"><td class="cellrowborder" valign="top" width="25.77%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233761785__ac13cb8e8024f471787b0b75ef5301c32">indpred</p>
</td>
<td class="cellrowborder" valign="top" width="16.73%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233761785__a5b3fae7fdb0249b4a154aa172e4b446e">pg_node_tree</p>
</td>
<td class="cellrowborder" valign="top" width="57.49999999999999%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233761785__a036e33d823714f26bac86fa584f25c3e">Expression tree (in <strong id="EN-US_TOPIC_0000001233761785__b144403498118">nodeToString()</strong> representation) for partial index predicate. If the index is not a partial index, the value is null.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0561.html">System Catalogs</a></div>
</div>
</div>