forked from docs/doc-exports
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>
121 lines
12 KiB
HTML
121 lines
12 KiB
HTML
<a name="EN-US_TOPIC_0000001233883265"></a><a name="EN-US_TOPIC_0000001233883265"></a>
|
|
|
|
<h1 class="topictitle1">PG_STATISTIC</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001233883265__en-us_topic_0059778435_p18731450056"><strong id="EN-US_TOPIC_0000001233883265__b018322251510">PG_STATISTIC</strong> records statistics about tables and index columns in a database. It is accessible only to users with system administrator rights.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233883265__t2810dff411d445899fa59065efdff597" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PG_STATISTIC columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233883265__rb434b352913a47dfaad73af7b7efc141"><th align="left" class="cellrowborder" valign="top" width="18.25%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001233883265__a7c90d4bce4044c07bfa5c6e8a4925eab"><strong id="EN-US_TOPIC_0000001233883265__b84235270691445">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.85%" id="mcps1.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001233883265__afc4549aca9094d34b7462a622261303b">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="66.9%" id="mcps1.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001233883265__a96c115d5ae944b28838840d3769e437f">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001233883265__r59811a2f067842d08346be4869776917"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__afe704bebb7cb4ef09ebb5e1f2e5c3eb4">starelid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__a68acc5a77242475c800560bb33c6a8be">oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a65eee433a9aa4f0f9d913ce607d93ffa">Table or index which the described column belongs to</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__r1aea0dd84a1b410eacb7ebd8d222329a"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__a4e994ecc42d645d48466b59eae9e2214">starelkind</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__ac75d16b7e2784b31830eca41ba797ee2">"char"</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__ab6c38b0e94eb43138eff82d98a5ea323">Type of an object</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__ra5f577bdcf9542e48f4e3e0ca56b39fe"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__ac129927c04a9467ca647411a880d8947">staattnum</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__aaf265610f40f40ae891d5db4002822a9">smallint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a8041f3bc53094c7cb382535d547acf7c">Number of the described column in the table, starting from 1</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__ra36279afdddc4263846b5bb43ee99a21"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__a1e4393c8191c4ef5b291a18fc60bfd6b">stainherit</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__a07bfb8a936284d6f9b63b9db88a17efe"><span id="EN-US_TOPIC_0000001233883265__text1155673073816">boolean</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a9caa7f11c8e746c1addc13ee31204329">Whether to collect statistics for objects that have inheritance relationship</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__ra1884a3206b44661a5cb3edf25ce73b9"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__aec45a675ce774b8da3f3829866cf799b">stanullfrac</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__a53aeba4bd23c4440a5bbba120b83f65c">real</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a096d5e3ca743416dbfef56c326d52359">Percentage of column entries that are null</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__r987d0330fc1e4069a29f2cab3581bc0f"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__adaa8aef03bd040f98c701625ca736129">stawidth</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__aa99c8e6450284e75a54a95d6a9caf4b3">integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a19cb65a40b8b4b88923e37fa5c382c3c">Average stored width, in bytes, of non-null entries</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__r20f8afce816c400bae7eec80ba12c07d"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__ab284e5e75ee949fa8e542155ed8664d8">stadistinct</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__a8e1becb6758d400bbb91bddce5da403b">real</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a3adfe5989d354fb1b0776878a4a76d21">Number of distinct, not-null data values in the column for all DNs</p>
|
|
<ul id="EN-US_TOPIC_0000001233883265__u7e3c9b2b7a1446ef86c589782bb6eadd"><li id="EN-US_TOPIC_0000001233883265__l1fcf9796f3a642318485e299d3230658">A value greater than zero is the actual number of distinct values.</li><li id="EN-US_TOPIC_0000001233883265__l3bfe7b3de2e64e69bd70193b709eac41">A value less than zero is the negative of a multiplier for the number of rows in the table. (For example, <strong id="EN-US_TOPIC_0000001233883265__b2524147713">stadistinct=-0.5</strong> indicates that values in a column appear twice on average.)</li><li id="EN-US_TOPIC_0000001233883265__la668563848d1402fac4cb8f6e135e3ac"><strong id="EN-US_TOPIC_0000001233883265__b549055312517">0</strong> indicates that the number of distinct values is unknown.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__r5dc3a533de594ee2a04164a7b07d1e00"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__a2964174283634e42a380de47313d45f5">stakindN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__a72942c28c9d94fa887856924f606aa28">smallint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a12dc85f75edc464392536cec13fa50f8">Code number stating that the type of statistics is stored in Slot N of the <strong id="EN-US_TOPIC_0000001233883265__a557c27084e754979a46c4cf6094a222c">pg_statistic</strong> row.</p>
|
|
<p id="EN-US_TOPIC_0000001233883265__adc2ff1653ea84903943cefa83dab7df2">Value range: 1 to 5</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__rf26c4375230148e4a3fdaf7ec778b85b"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__ab253052dfd5f489685c530b251669e5a">staopN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__ab2b7e159b07b4058b87fc9e9070ad19d">oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__aa19c9d5695b44089bdf55966b557e6a2">Operator used to generate the statistics stored in Slot N. For example, a histogram slot shows the < operator that defines the sort order of the data.</p>
|
|
<p id="EN-US_TOPIC_0000001233883265__a84d3fc988a7e413482d977d7d6231c8e">Value range: 1 to 5</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__r318f4c1c578a4038a7a23f8ba78756c4"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__a2289f8d69cd14066bb10c46697e9cc12">stanumbersN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__a40e68a95623343a580dbf3028ab7a397">real[]</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a003fdaf45cbe40f8b3fb239ca84c1894">Numerical statistics of the appropriate type for Slot N. The value is null if the slot kind does not involve numerical values.</p>
|
|
<p id="EN-US_TOPIC_0000001233883265__aff3a3d7b6e194ff693c4ef08844377f1">Value range: 1 to 5</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__re8a2c8dc9770467983ab4f85a319901c"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__a43e32d3d39db42539bd1f7e9cb371ef6">stavaluesN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__a1a9dc8304cd84a76a85accc0c7acd8d9">anyarray</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__ae1d259eb66d543c7a6b79510f5741d70">Column data values of the appropriate type for Slot N. The value is null if the slot type does not store any data values. Each array's element values are actually of the specific column's data type so there is no way to define these columns' type more specifically than anyarray.</p>
|
|
<p id="EN-US_TOPIC_0000001233883265__a14888428bcf9456295dfd67d422a1c6f">Value range: 1 to 5</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__refb5d9a7c60641f1bde2d6ad644151e8"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__ae0fcbb9870424b6092d01b31423b7dc9">stadndistinct</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__adcbd160e41f64ab5a9cb80b8f5b5026f">real</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__a66166106ad764a0b8bbbac333a5c2616">Number of unique non-null data values in the <strong id="EN-US_TOPIC_0000001233883265__b84235270695425">dn1</strong> column</p>
|
|
<ul id="EN-US_TOPIC_0000001233883265__u2a950b2d77cc4fc188b55a2fafd7969d"><li id="EN-US_TOPIC_0000001233883265__ldc5e188a1d5643a38d2d44577197281d">A value greater than zero is the actual number of distinct values.</li><li id="EN-US_TOPIC_0000001233883265__l45d10d71906a48a1b4d65c1f32462de8">A value less than zero is the negative of a multiplier for the number of rows in the table. (For example, <strong id="EN-US_TOPIC_0000001233883265__b12436142017109">stadistinct=-0.5</strong> indicates that values in a column appear twice on average.)</li><li id="EN-US_TOPIC_0000001233883265__l6adcd55afd474ad2bddc257b1702f794"><strong id="EN-US_TOPIC_0000001233883265__b93721126111010">0</strong> indicates that the number of distinct values is unknown.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233883265__row1590511431613"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233883265__p2905181401614">staextinfo</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233883265__p3905111491616">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233883265__p169058144161">Information about extension statistics (reserved)</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>
|
|
|