doc-exports/docs/dws/dev/dws_04_0620.html
Lu, Huayi a24ca60074 DWS DEVELOPER 811 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-01-19 13:37:49 +00:00

121 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000001145495043"></a><a name="EN-US_TOPIC_0000001145495043"></a>
<h1 class="topictitle1">PG_STATISTIC_EXT</h1>
<div id="body1539078260184"><p id="EN-US_TOPIC_0000001145495043__en-us_topic_0059778435_p18731450056"><strong id="EN-US_TOPIC_0000001145495043__b339414175716">PG_STATISTIC_EXT</strong> records the extended statistics of tables in a database, such as statistics of multiple columns. Statistics of expressions will be supported later. You can specify the extended statistics to be collected. It is accessible only to users with system administrator rights.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001145495043__t2810dff411d445899fa59065efdff597" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PG_STATISTIC_EXT columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001145495043__rb434b352913a47dfaad73af7b7efc141"><th align="left" class="cellrowborder" valign="top" width="18.25%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001145495043__a7c90d4bce4044c07bfa5c6e8a4925eab">Parameter</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_0000001145495043__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_0000001145495043__a96c115d5ae944b28838840d3769e437f">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001145495043__r59811a2f067842d08346be4869776917"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__a65eee433a9aa4f0f9d913ce607d93ffa">Table or index which the described column belongs to</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__r1aea0dd84a1b410eacb7ebd8d222329a"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__ab6c38b0e94eb43138eff82d98a5ea323">Type of an object</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__ra36279afdddc4263846b5bb43ee99a21"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__a07bfb8a936284d6f9b63b9db88a17efe"><span id="EN-US_TOPIC_0000001145495043__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_0000001145495043__a9caa7f11c8e746c1addc13ee31204329">Whether to collect statistics for objects that have inheritance relationship</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__ra1884a3206b44661a5cb3edf25ce73b9"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__a096d5e3ca743416dbfef56c326d52359">Percentage of column entries that are null</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__r987d0330fc1e4069a29f2cab3581bc0f"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__a19cb65a40b8b4b88923e37fa5c382c3c">Average stored width, in bytes, of non-null entries</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__r20f8afce816c400bae7eec80ba12c07d"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__a3adfe5989d354fb1b0776878a4a76d21">Number of distinct, not-null data values in the column for all DNs</p>
<ul id="EN-US_TOPIC_0000001145495043__u7e3c9b2b7a1446ef86c589782bb6eadd"><li id="EN-US_TOPIC_0000001145495043__l1fcf9796f3a642318485e299d3230658">A value greater than zero is the actual number of distinct values.</li><li id="EN-US_TOPIC_0000001145495043__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_0000001145495043__b2524147713">stadistinct=-0.5</strong> indicates that values in a column appear twice on average.)</li><li id="EN-US_TOPIC_0000001145495043__la668563848d1402fac4cb8f6e135e3ac"><strong id="EN-US_TOPIC_0000001145495043__b678933471015">0</strong> indicates that the number of distinct values is unknown.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__row64543474101134"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__p8695731101136">stadndistinct</p>
</td>
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001145495043__p33265624101136">real</p>
</td>
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001145495043__p10161009101136">Number of unique non-null data values in the <strong id="EN-US_TOPIC_0000001145495043__b84235270695425">dn1</strong> column</p>
<ul id="EN-US_TOPIC_0000001145495043__ul24340221101136"><li id="EN-US_TOPIC_0000001145495043__li17735399101136">A value greater than zero is the actual number of distinct values.</li><li id="EN-US_TOPIC_0000001145495043__li25400864101136">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_0000001145495043__b942185386">stadistinct=-0.5</strong> indicates that values in a column appear twice on average.)</li><li id="EN-US_TOPIC_0000001145495043__li27281185101136"><strong id="EN-US_TOPIC_0000001145495043__b555783671020">0</strong> indicates that the number of distinct values is unknown.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__r5dc3a533de594ee2a04164a7b07d1e00"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__a12dc85f75edc464392536cec13fa50f8">Code number stating that the type of statistics is stored in Slot N of the <strong id="EN-US_TOPIC_0000001145495043__a557c27084e754979a46c4cf6094a222c">pg_statistic</strong> row.</p>
<p id="EN-US_TOPIC_0000001145495043__adc2ff1653ea84903943cefa83dab7df2">Value range: 1 to 5</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__rf26c4375230148e4a3fdaf7ec778b85b"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__aa19c9d5695b44089bdf55966b557e6a2">Operator used to generate the statistics stored in Slot N. For example, a histogram slot shows the &lt; operator that defines the sort order of the data.</p>
<p id="EN-US_TOPIC_0000001145495043__a84d3fc988a7e413482d977d7d6231c8e">Value range: 1 to 5</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__row38308723172423"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__p48981074172425">stakey</p>
</td>
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001145495043__p8044056172425">int2vector</p>
</td>
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001145495043__p47588770172425">Array of a column ID</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__r318f4c1c578a4038a7a23f8ba78756c4"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__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_0000001145495043__aff3a3d7b6e194ff693c4ef08844377f1">Value range: 1 to 5</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__re8a2c8dc9770467983ab4f85a319901c"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__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_0000001145495043__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_0000001145495043__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_0000001145495043__a14888428bcf9456295dfd67d422a1c6f">Value range: 1 to 5</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001145495043__row1590511431613"><td class="cellrowborder" valign="top" width="18.25%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001145495043__p2905181401614">staexprs</p>
</td>
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001145495043__p3905111491616">pg_node_tree</p>
</td>
<td class="cellrowborder" valign="top" width="66.9%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001145495043__p5062986022442">Expression corresponding to the extended statistics information.</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>