doc-exports/docs/dws/dev/dws_06_0062.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

295 lines
55 KiB
HTML

<a name="EN-US_TOPIC_0000001098990696"></a><a name="EN-US_TOPIC_0000001098990696"></a>
<h1 class="topictitle1">Other Functions</h1>
<div id="body1553151203304"><ul id="EN-US_TOPIC_0000001098990696__ub16f1f13d58c4710881d282e8991294c"><li id="EN-US_TOPIC_0000001098990696__l155387e0f88c4666821990489db4fd41">pgxc_pool_check()<p id="EN-US_TOPIC_0000001098990696__a3820eed6c23b4368ba954bd3411018f1"><a name="EN-US_TOPIC_0000001098990696__l155387e0f88c4666821990489db4fd41"></a><a name="l155387e0f88c4666821990489db4fd41"></a>Description: Checks whether the connection data buffered in the pool is consistent with <strong id="EN-US_TOPIC_0000001098990696__b4441144314374">pgxc_node</strong>.</p>
<p id="EN-US_TOPIC_0000001098990696__a9334ef0d49174c32b280db72aa4da67d">Return type: <span id="EN-US_TOPIC_0000001098990696__text13738253202213">boolean</span></p>
</li><li id="EN-US_TOPIC_0000001098990696__l4959044dee8942beb9a6a540cc2f7539">pgxc_pool_reload()<p id="EN-US_TOPIC_0000001098990696__a92bfda29eb6245c2b011db6352b89322"><a name="EN-US_TOPIC_0000001098990696__l4959044dee8942beb9a6a540cc2f7539"></a><a name="l4959044dee8942beb9a6a540cc2f7539"></a>Description: Updates the connection information buffered in the pool.</p>
<p id="EN-US_TOPIC_0000001098990696__a0a19cdb9d5954b16b796bcf8244de908">Return type: <span id="EN-US_TOPIC_0000001098990696__text113391254172212">boolean</span></p>
</li><li id="EN-US_TOPIC_0000001098990696__le1d2a0f20443439391222042ab40a09f">pgxc_lock_for_backup()<p id="EN-US_TOPIC_0000001098990696__a0c4ee469805546c68cb05a643620e467"><a name="EN-US_TOPIC_0000001098990696__le1d2a0f20443439391222042ab40a09f"></a><a name="le1d2a0f20443439391222042ab40a09f"></a>Description: Locks the cluster before backup. Backup is performed to restore data on new nodes.</p>
<p id="EN-US_TOPIC_0000001098990696__a13b5730683964a308ff824c864cd2f1e">Return type: <span id="EN-US_TOPIC_0000001098990696__text17885115472214">boolean</span></p>
<div class="note" id="EN-US_TOPIC_0000001098990696__nb415b577c44e455abaa6e0e704f933dc"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001098990696__a0e00c93eec164d4495631f036056dde2"><strong id="EN-US_TOPIC_0000001098990696__b842352706144724">pgxc_lock_for_backup</strong> locks a cluster before <strong id="EN-US_TOPIC_0000001098990696__b84235270614488">gs_dump</strong> or <strong id="EN-US_TOPIC_0000001098990696__b842352706144813">gs_dumpall</strong> is used to back up the cluster. After a cluster is locked, operations changing the system structure are not allowed. This function does not affect DML statements.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001098990696__lf6e8af2bbb244e6ca309d09efe93ffba">pg_pool_validate(clear boolean, co_node_name cstring)<p id="EN-US_TOPIC_0000001098990696__p5424929954"><a name="EN-US_TOPIC_0000001098990696__lf6e8af2bbb244e6ca309d09efe93ffba"></a><a name="lf6e8af2bbb244e6ca309d09efe93ffba"></a>Description: Clears invalid backend threads on a CN. (These backend threads hold invalid pooler connections to standby DNs.)</p>
<p id="EN-US_TOPIC_0000001098990696__a4d2e82a3f6084e95b856939a6fe2bf71">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__ld037239c262c473cb1c52d8e37fd7569">pg_nodes_memory()<p id="EN-US_TOPIC_0000001098990696__ab11e22da613549b6918f1604f1668d7b"><a name="EN-US_TOPIC_0000001098990696__ld037239c262c473cb1c52d8e37fd7569"></a><a name="ld037239c262c473cb1c52d8e37fd7569"></a>Description: queries the memory usage of all nodes.</p>
<p id="EN-US_TOPIC_0000001098990696__a23ff9922c2054ff4a20acc0921f65b5d">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__lebd4d85fa024441f94d461997a22229e">table_skewness(text)<p id="EN-US_TOPIC_0000001098990696__a3bae6d4af1784c8d834145f65b5c49f3"><a name="EN-US_TOPIC_0000001098990696__lebd4d85fa024441f94d461997a22229e"></a><a name="lebd4d85fa024441f94d461997a22229e"></a>Description: queries the percentage of table data among all nodes.</p>
<p id="EN-US_TOPIC_0000001098990696__a236ad5ebfddc4db9a56c20ef7982148f">Parameter: Indicates that the type of the name of the to-be-queried table is text.</p>
<p id="EN-US_TOPIC_0000001098990696__aa5d5958919444ff08a83bec5ef8aaf14">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li111825414215">table_skewness(table_name text, column_name text[, row_num text])<p id="EN-US_TOPIC_0000001098990696__p1765368144212"><a name="EN-US_TOPIC_0000001098990696__li111825414215"></a><a name="li111825414215"></a>Description: Queries the proportion of column data distributed on each node based on the hash distribution rule. The results are sorted based on the data volumes of the nodes.</p>
<p id="EN-US_TOPIC_0000001098990696__p12270181116425">Parameters: <strong id="EN-US_TOPIC_0000001098990696__b15883522204411">table_name</strong> indicates a table name, <strong id="EN-US_TOPIC_0000001098990696__b724423234411">column_name</strong> indicates a column name, and <strong id="EN-US_TOPIC_0000001098990696__b24911647174410">row_num</strong> indicates that all data in the current column is returned. The default value is <strong id="EN-US_TOPIC_0000001098990696__b1173245618440">0</strong>. A value other than <strong id="EN-US_TOPIC_0000001098990696__b191861056418">0</strong> indicates the number of data records whose statistics are sampled. (Records are randomly sampled.)</p>
<p id="EN-US_TOPIC_0000001098990696__p93941227144916">Return type: record</p>
<p id="EN-US_TOPIC_0000001098990696__p1713555194213">Example:</p>
<p id="EN-US_TOPIC_0000001098990696__p88378419515">Distribute data by hash based on the <strong id="EN-US_TOPIC_0000001098990696__b491413211613">a</strong> column in the <strong id="EN-US_TOPIC_0000001098990696__b4586123617618">tx</strong> table. Seven records are distributed on DN 1, two records on DN 2, and one record on DN 0.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001098990696__screen10350105213465"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">select</span><span class="w"> </span><span class="n">table_skewness</span><span class="p">(</span><span class="s1">'tx'</span><span class="p">,</span><span class="s1">'a'</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">table_skewness</span><span class="w"> </span>
<span class="c1">----------------</span>
<span class="w"> </span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">7</span><span class="p">,</span><span class="mi">70</span><span class="p">.</span><span class="mi">000</span><span class="o">%</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">20</span><span class="p">.</span><span class="mi">000</span><span class="o">%</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">10</span><span class="p">.</span><span class="mi">000</span><span class="o">%</span><span class="p">)</span><span class="w"></span>
<span class="p">(</span><span class="mi">3</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span><span class="w"></span>
</pre></div></td></tr></table></div>
</div>
</li><li id="EN-US_TOPIC_0000001098990696__li16924174017456">table_data_skewness(data_row record, locatorType "char")<p id="EN-US_TOPIC_0000001098990696__p1592314044510"><a name="EN-US_TOPIC_0000001098990696__li16924174017456"></a><a name="li16924174017456"></a>Description: Calculates the bucket distribution index for the records concatenated using the columns in a specified table.</p>
<p id="EN-US_TOPIC_0000001098990696__p89235400458">Parameters: <strong id="EN-US_TOPIC_0000001098990696__b748983513137">data_row</strong> indicates the record concatenated using columns in the specified table. <strong id="EN-US_TOPIC_0000001098990696__b8523529171419">locatorType</strong> indicates the distribution rule. You are advised to set <strong id="EN-US_TOPIC_0000001098990696__b586624610140">locatorType</strong> to <strong id="EN-US_TOPIC_0000001098990696__b1184313345141">H</strong>, indicating hash distribution.</p>
<p id="EN-US_TOPIC_0000001098990696__p79231240174512">Return type: smallint</p>
<p id="EN-US_TOPIC_0000001098990696__p5923154019454">Example:</p>
<p id="EN-US_TOPIC_0000001098990696__p16923204004510">Calculates the bucket distribution index based on the hash distribution rule for the records combined concatenated using the columns in the <strong id="EN-US_TOPIC_0000001098990696__b128033127172">tx</strong> table.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001098990696__screen137011098508"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span>
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">select</span><span class="w"> </span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="n">table_data_skewness</span><span class="p">(</span><span class="k">row</span><span class="p">(</span><span class="n">a</span><span class="p">),</span><span class="w"> </span><span class="s1">'H'</span><span class="p">)</span><span class="w"> </span><span class="k">from</span><span class="w"> </span><span class="n">tx</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">table_data_skewness</span><span class="w"> </span>
<span class="c1">---+---------------------</span>
<span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
<span class="w"> </span><span class="mi">6</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">2</span><span class="w"></span>
<span class="w"> </span><span class="mi">7</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">2</span><span class="w"></span>
<span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">1</span><span class="w"></span>
<span class="p">(</span><span class="mi">5</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span><span class="w"></span>
</pre></div></td></tr></table></div>
</div>
</li><li id="EN-US_TOPIC_0000001098990696__li740916348447">table_distribution(schemaname text, tablename text)<p id="EN-US_TOPIC_0000001098990696__p194251334194414"><a name="EN-US_TOPIC_0000001098990696__li740916348447"></a><a name="li740916348447"></a>Description: queries the storage space occupied by a specified table on each node.</p>
<p id="EN-US_TOPIC_0000001098990696__p4437834164414">Parameter: Indicates that the types of the schema name and table name for the table to be queried are both text.</p>
<p id="EN-US_TOPIC_0000001098990696__p1344893434419">Return type: record</p>
<div class="note" id="EN-US_TOPIC_0000001098990696__note1075515420251"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001098990696__ul095205472817"><li id="EN-US_TOPIC_0000001098990696__li7958022172212">To query for the storage distribution of a specified table by using this function, you must have the <strong id="EN-US_TOPIC_0000001098990696__b2419194710270">SELECT</strong> permission for the table.</li><li id="EN-US_TOPIC_0000001098990696__li19952115411281">The performance of <strong id="EN-US_TOPIC_0000001098990696__b1054342794416">table_distribution</strong> is better than that of <strong id="EN-US_TOPIC_0000001098990696__b41216327441">table_skewness</strong>. Especially in a large cluster with a large amount of data, <strong id="EN-US_TOPIC_0000001098990696__b143743734417">table_distribution</strong> is recommended.</li><li id="EN-US_TOPIC_0000001098990696__li353105722816">When you use <strong id="EN-US_TOPIC_0000001098990696__b115061945134412">table_distribution</strong> and want to view the space usage, you can use <strong id="EN-US_TOPIC_0000001098990696__b851414618259">dnsize</strong> or <strong id="EN-US_TOPIC_0000001098990696__b669255242520">(sum(dnsize) over ())</strong> to view the percentage.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001098990696__li129935376269">table_distribution(regclass)<p id="EN-US_TOPIC_0000001098990696__p109931373265"><a name="EN-US_TOPIC_0000001098990696__li129935376269"></a><a name="li129935376269"></a>Description: queries the storage space occupied by a specified table on each node.</p>
<p id="EN-US_TOPIC_0000001098990696__p599313712619">Parameter: indicates the name or OID of the table to be queried. The table name can be defined by the schema name. Parameter type: regclass</p>
<p id="EN-US_TOPIC_0000001098990696__p1999373702613">Return type: record</p>
<div class="note" id="EN-US_TOPIC_0000001098990696__note13993337142616"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001098990696__ul132421612315"><li id="EN-US_TOPIC_0000001098990696__li324256112319">To query for the storage distribution of a specified table by using this function, you must have the <strong id="EN-US_TOPIC_0000001098990696__b1477513775">SELECT</strong> permission for the table.</li><li id="EN-US_TOPIC_0000001098990696__li424236172319">The performance of <strong id="EN-US_TOPIC_0000001098990696__b2046785475">table_distribution</strong> is better than that of <strong id="EN-US_TOPIC_0000001098990696__b1180586443">table_skewness</strong>. Especially in a large cluster with a large amount of data, <strong id="EN-US_TOPIC_0000001098990696__b1105532580">table_distribution</strong> is recommended.</li><li id="EN-US_TOPIC_0000001098990696__li824211611237">When you use <strong id="EN-US_TOPIC_0000001098990696__b749866071">table_distribution</strong> and want to view the space usage, you can use <strong id="EN-US_TOPIC_0000001098990696__b662045978">dnsize</strong> or <strong id="EN-US_TOPIC_0000001098990696__b1848908970">(sum(dnsize) over ())</strong> to view the percentage.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001098990696__li645551081820">table_distribution()<p id="EN-US_TOPIC_0000001098990696__p1446491061812"><a name="EN-US_TOPIC_0000001098990696__li645551081820"></a><a name="li645551081820"></a>Description: queries the storage distribution of all tables in the current database.</p>
<p id="EN-US_TOPIC_0000001098990696__p2471910111810">Return type: record</p>
<div class="note" id="EN-US_TOPIC_0000001098990696__note12816174919237"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001098990696__ul537435432913"><li id="EN-US_TOPIC_0000001098990696__li737465411299">This function involves the query for information about all tables in the database. To execute this function, you must have the administrator rights.</li><li id="EN-US_TOPIC_0000001098990696__li123741854152910">Based on the table_distribution() function, <span id="EN-US_TOPIC_0000001098990696__text769433086">GaussDB(DWS)</span> provides the PGXC_GET_TABLE_SKEWNESS view as an alternative way to query for data skew. You are advised to use this view when the number of tables in the database is less than 10000.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001098990696__li1957554511497">pgxc_get_stat_dirty_tables(int dirty_percent, int n_tuples)<p id="EN-US_TOPIC_0000001098990696__p157041557125012"><a name="EN-US_TOPIC_0000001098990696__li1957554511497"></a><a name="li1957554511497"></a>Description: Obtains information about insertion, update, and deletion operations on tables and the dirty page rate of tables. This function optimizes the performance of the <strong id="EN-US_TOPIC_0000001098990696__b4453163114910">PGXC_GET_STAT_ALL_TABLES</strong> view. It can quickly filter out tables whose dirty page rate is greater than <strong id="EN-US_TOPIC_0000001098990696__b6447132024914">dirty_percent</strong> and number of dead tuples is greater than <strong id="EN-US_TOPIC_0000001098990696__b531211309490">n_tuples</strong>.</p>
<p id="EN-US_TOPIC_0000001098990696__p47611019144017">Return type: SETOF record</p>
<p id="EN-US_TOPIC_0000001098990696__p897491117513">The following table describes return columns.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001098990696__t09d8e10f76724678a8f221dd29db736a" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001098990696__r296db8ff4a4f4195b3fd7d935ac3436d"><th align="left" class="cellrowborder" valign="top" width="33.33%" id="mcps1.3.1.12.4.1.4.1.1"><p id="EN-US_TOPIC_0000001098990696__aabed0b68691942108b0e3aa157377da7">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.919999999999998%" id="mcps1.3.1.12.4.1.4.1.2"><p id="EN-US_TOPIC_0000001098990696__aae8adcb14b634a4793c5c29a8ded37cd">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48.75%" id="mcps1.3.1.12.4.1.4.1.3"><p id="EN-US_TOPIC_0000001098990696__a4d5efd63bff341d59af7eb1359385af9">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001098990696__r4058f6bdc9254911b191aa0e08d7edb6"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p1160011111301">relid</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__ac9c372b991894c798b9fecec1fe03ea8">oid</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__aa4d470d9917d4fedbce5cd58c754ce42">Table OID</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__r9a69c15440fd4b3d86b38804ac7efffd"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p155841225203011">relname</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__a6f502ef221ec4b8d8e5393022effc5bd">name</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__a13de41723a05484d86ab3c303d4c522a">Table name</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row1596942488"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p897184184816">schemaname</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p89817484814">name</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p1099145484">Schema name of the table</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__r3b0439badf02493a9fc3a84029209848"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p1219664054117">n_tup_ins</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p7372640124113">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__aca413da9e4ea45aba0d8b389dcf956ec">Number of inserted tuples</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row204781949282"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p194796491814">n_tup_upd</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p165202104211">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p204793499820">Number of updated tuples</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row4302327154218"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p14386104410421">n_tup_del</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p1138142494218">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p1130472764213">Number of deleted tuples</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row174687374424"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p04691337114217">n_live_tup</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p1538102414424">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p154709379429">Number of live tuples</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row157104984219"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p16874914210">n_dead_tup</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p179134915423">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p199174924217">Number of dead tuples</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row14389195612816"><td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.1.12.4.1.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p559332324316">dirty_page_rate</p>
</td>
<td class="cellrowborder" valign="top" width="17.919999999999998%" headers="mcps1.3.1.12.4.1.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p1636555125610">numeric(5,2)</p>
</td>
<td class="cellrowborder" valign="top" width="48.75%" headers="mcps1.3.1.12.4.1.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p14390856089">Dirty page rate (%) of a table</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0000001098990696__li17288181719523">pgxc_get_stat_dirty_tables(int dirty_percent, int n_tuples, text schema)<p id="EN-US_TOPIC_0000001098990696__p125935186521"><a name="EN-US_TOPIC_0000001098990696__li17288181719523"></a><a name="li17288181719523"></a>Description: Obtains information about insertion, update, and deletion operations on tables and the dirty page rate of tables. This function can quickly filter out tables whose dirty page rate is greater than <strong id="EN-US_TOPIC_0000001098990696__b11594105565111">page_dirty_rate</strong>, number of dead tuples is greater than <strong id="EN-US_TOPIC_0000001098990696__b531611415219">n_tuples</strong>, and schema name is <strong id="EN-US_TOPIC_0000001098990696__b519801765215">schema</strong>.</p>
<p id="EN-US_TOPIC_0000001098990696__p1059451825213">Return type: SETOF record</p>
<p id="EN-US_TOPIC_0000001098990696__p723335020121">The return columns of the function are the same as those of the <strong id="EN-US_TOPIC_0000001098990696__b1387433012533">pgxc_get_stat_dirty_tables(int dirty_percent, int n_tuples)</strong> function.</p>
</li><li id="EN-US_TOPIC_0000001098990696__l175e5615fd2c41d2bca52dedb74dbd0b">plan_seed()<p id="EN-US_TOPIC_0000001098990696__a8657ec7c01ec42f8a38d4ffea7fa254e"><a name="EN-US_TOPIC_0000001098990696__l175e5615fd2c41d2bca52dedb74dbd0b"></a><a name="l175e5615fd2c41d2bca52dedb74dbd0b"></a>Description: Obtains the seed value of the previous query statement (internal use).</p>
<p id="EN-US_TOPIC_0000001098990696__ac2ca78f72baa48b5885c8aca3ff1e991">Return type: int</p>
</li><li id="EN-US_TOPIC_0000001098990696__la1b9ce4db549468392d2993c34e37269">pg_stat_get_env()<p id="EN-US_TOPIC_0000001098990696__ae76e31e4d5f6422bbec0f57fb8c74867"><a name="EN-US_TOPIC_0000001098990696__la1b9ce4db549468392d2993c34e37269"></a><a name="la1b9ce4db549468392d2993c34e37269"></a>Description: Obtains the environment variable information about the current node.</p>
<p id="EN-US_TOPIC_0000001098990696__a3795fc0706a34db1a32bad5106a1f510">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__l8778d7256ef64c24b9e2e613ab827cb8">pg_stat_get_thread()<p id="EN-US_TOPIC_0000001098990696__affe41ea584364803a18cca81c14f1344"><a name="EN-US_TOPIC_0000001098990696__l8778d7256ef64c24b9e2e613ab827cb8"></a><a name="l8778d7256ef64c24b9e2e613ab827cb8"></a>Description: Provides information about the status of all threads under the current node.</p>
<p id="EN-US_TOPIC_0000001098990696__af4327fe3f64b4d498aabf8a2c5c5f472">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__l00fae37c3fa44a16825892e01e719f3c">pgxc_get_os_threads()<p id="EN-US_TOPIC_0000001098990696__abb20d6c352da434eafb0e5755f3e77af"><a name="EN-US_TOPIC_0000001098990696__l00fae37c3fa44a16825892e01e719f3c"></a><a name="l00fae37c3fa44a16825892e01e719f3c"></a>Description: Provides information about the status of threads under all normal nodes in a cluster.</p>
<p id="EN-US_TOPIC_0000001098990696__add58164068f84476aadcfac69625f1ab">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li1278714176552">pg_stat_get_sql_count()<p id="EN-US_TOPIC_0000001098990696__p1271652635812"><a name="EN-US_TOPIC_0000001098990696__li1278714176552"></a><a name="li1278714176552"></a>Description: Provides statistics on the number of <strong id="EN-US_TOPIC_0000001098990696__b120575717451">SELECT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b1215119154617">UPDATE</strong>/<strong id="EN-US_TOPIC_0000001098990696__b198671731469">INSERT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b96032624614">DELETE</strong>/<strong id="EN-US_TOPIC_0000001098990696__b564918117463">MERGE INTO</strong> statements executed by all users on the current node, response time, and the number of DDL, DML, and DCL statements.</p>
<p id="EN-US_TOPIC_0000001098990696__p392824018012">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li96021711715">pgxc_get_sql_count()<p id="EN-US_TOPIC_0000001098990696__p161602619918"><a name="EN-US_TOPIC_0000001098990696__li96021711715"></a><a name="li96021711715"></a>Description: Provides statistics on the number of <strong id="EN-US_TOPIC_0000001098990696__b19259114594715">SELECT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b12259445194717">UPDATE</strong>/<strong id="EN-US_TOPIC_0000001098990696__b17260645144718">INSERT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b16261134513476">DELETE</strong>/<strong id="EN-US_TOPIC_0000001098990696__b19261114564716">MERGE INTO</strong> statements executed by all users on all nodes of the current cluster, response time, and the number of DDL, DML, and DCL statements.</p>
<p id="EN-US_TOPIC_0000001098990696__p1622316281396">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li19211205994613">pgxc_get_workload_sql_count()<p id="EN-US_TOPIC_0000001098990696__p7211259104612"><a name="EN-US_TOPIC_0000001098990696__li19211205994613"></a><a name="li19211205994613"></a>Description: Provides statistics on the number of <strong id="EN-US_TOPIC_0000001098990696__b14249656124713">SELECT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b102490569471">UPDATE</strong>/<strong id="EN-US_TOPIC_0000001098990696__b5249656204718">INSERT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b724955684713">DELETE</strong> statements executed in all workload Cgroup on all CNs of the current cluster and the number of DDL, DML, and DCL statements.</p>
<p id="EN-US_TOPIC_0000001098990696__p521255913463">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li1119103115212">pgxc_get_workload_sql_elapse_time()<p id="EN-US_TOPIC_0000001098990696__p181196311214"><a name="EN-US_TOPIC_0000001098990696__li1119103115212"></a><a name="li1119103115212"></a>Description: Provides statistics on response time of <strong id="EN-US_TOPIC_0000001098990696__b163719332530">SELECT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b96376339534">UPDATE</strong>/<strong id="EN-US_TOPIC_0000001098990696__b16637933125310">INSERT</strong>/<strong id="EN-US_TOPIC_0000001098990696__b18637103365317">DELETE</strong> statements executed in all workload Cgroup on all CNs of the current cluster.</p>
<p id="EN-US_TOPIC_0000001098990696__p19119103119211">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li1990618216466">get_instr_unique_sql()<p id="EN-US_TOPIC_0000001098990696__p990652115463"><a name="EN-US_TOPIC_0000001098990696__li1990618216466"></a><a name="li1990618216466"></a>Description: Provides information about Unique SQL statistics collected on the current node. If the node is a CN, the system returns the complete information about the Unique SQL statistics collected on the CN. That is, the system collects and summarizes the information about the Unique SQL statistics on other CNs and DNs. If the node is a DN, the Unique SQL statistics on the DN is returned. For details, see GS_INSTR_UNIQUE_SQL.</p>
<p id="EN-US_TOPIC_0000001098990696__p2906921164620">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li10965105224519">reset_instr_unique_sql(cstring, cstring, INT8)<p id="EN-US_TOPIC_0000001098990696__p858885105013"><a name="EN-US_TOPIC_0000001098990696__li10965105224519"></a><a name="li10965105224519"></a>Description: Clears collected Unique SQL statistics. The input parameters are described as follows:</p>
<ul id="EN-US_TOPIC_0000001098990696__ul423903723117"><li id="EN-US_TOPIC_0000001098990696__li19140927173120"><strong id="EN-US_TOPIC_0000001098990696__b39261410950">GLOBAL</strong>/<strong id="EN-US_TOPIC_0000001098990696__b11181131554">LOCAL</strong>: Data is cleared from all nodes or the current node.</li><li id="EN-US_TOPIC_0000001098990696__li41687274310"><strong id="EN-US_TOPIC_0000001098990696__b194871224351">ALL</strong>/<strong id="EN-US_TOPIC_0000001098990696__b1072312279518">BY_USERID</strong>/<strong id="EN-US_TOPIC_0000001098990696__b13156113114513">BY_CNID</strong>/<strong id="EN-US_TOPIC_0000001098990696__b62066341753">BY_GUC</strong>: <strong id="EN-US_TOPIC_0000001098990696__b599714615518">ALL</strong> indicates that all data is cleared. <strong id="EN-US_TOPIC_0000001098990696__b169801658659">BY_USERID/BY_CNID</strong> indicates that data is cleared by <strong id="EN-US_TOPIC_0000001098990696__b16145179619">USERID</strong> or <strong id="EN-US_TOPIC_0000001098990696__b1954219868">CNID</strong>. <strong id="EN-US_TOPIC_0000001098990696__b196905281566">BY_GUC</strong> indicates that the clearance operation is caused by the decrease of the value of the GUC parameter <strong id="EN-US_TOPIC_0000001098990696__b1734019439613">instr_unique_sql_count</strong>.</li><li id="EN-US_TOPIC_0000001098990696__li21697271319">The third parameter corresponds to the second parameter. The parameter is invalid for <strong id="EN-US_TOPIC_0000001098990696__b2344173413718">ALL</strong>/<strong id="EN-US_TOPIC_0000001098990696__b19613143714711">BY_GUC</strong>.</li></ul>
<p id="EN-US_TOPIC_0000001098990696__p1137919425310">Return type: bool</p>
</li><li id="EN-US_TOPIC_0000001098990696__li841719242719">pgxc_get_instr_unique_sql()<p id="EN-US_TOPIC_0000001098990696__p44171217277"><a name="EN-US_TOPIC_0000001098990696__li841719242719"></a><a name="li841719242719"></a>Description: Provides complete information about Unique SQL statistics collected on all CNs in a cluster. This function can be executed only on CNs.</p>
<p id="EN-US_TOPIC_0000001098990696__p164177219279">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li42691804333">get_instr_unique_sql_remote_cns()<p id="EN-US_TOPIC_0000001098990696__p1426915063317"><a name="EN-US_TOPIC_0000001098990696__li42691804333"></a><a name="li42691804333"></a>Description: Provides complete information about Unique SQL statements collected on all CNs in the cluster, except the CN on which the function is being executed. This function can be executed only on CNs.</p>
<p id="EN-US_TOPIC_0000001098990696__p1426917073313">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__l90e36b1635394934a09891c1bf7edb38">pgxc_get_node_env()<p id="EN-US_TOPIC_0000001098990696__abd40a82caf1943d89d2ba1d62ba6f922"><a name="EN-US_TOPIC_0000001098990696__l90e36b1635394934a09891c1bf7edb38"></a><a name="l90e36b1635394934a09891c1bf7edb38"></a>Description: Provides the environment variable information about all nodes in a cluster.</p>
<p id="EN-US_TOPIC_0000001098990696__ad05c43a83f044af18c180223483681e6">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__la07325c5285c4aed862a90f0daebadaa">gs_switch_relfilenode()<p id="EN-US_TOPIC_0000001098990696__a4462c7a6369b412fb3ff008abeeebef5"><a name="EN-US_TOPIC_0000001098990696__la07325c5285c4aed862a90f0daebadaa"></a><a name="la07325c5285c4aed862a90f0daebadaa"></a>Description: Exchanges meta information of two tables or partitions. (This is only used for the redistribution tool. An error message is displayed when the function is directly used by users).</p>
<p id="EN-US_TOPIC_0000001098990696__a108d392d9f6b4de682a567a95e4dcbd9">Return type: int</p>
</li><li id="EN-US_TOPIC_0000001098990696__li144841172189">copy_error_log_create()<p id="EN-US_TOPIC_0000001098990696__p11489111720188"><a name="EN-US_TOPIC_0000001098990696__li144841172189"></a><a name="li144841172189"></a>Description: Creates the error table (<strong id="EN-US_TOPIC_0000001098990696__b5277134318517">public.pgxc_copy_error_log</strong>) required for creating the <strong id="EN-US_TOPIC_0000001098990696__b22791843125117">COPY FROM</strong> error tolerance mechanism.</p>
<p id="EN-US_TOPIC_0000001098990696__p1649212172187">Return type: <span id="EN-US_TOPIC_0000001098990696__text9105556192216">boolean</span></p>
<div class="note" id="EN-US_TOPIC_0000001098990696__note1064319395209"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001098990696__ul31245139401"><li id="EN-US_TOPIC_0000001098990696__li1535115326494">This function attempts to create the <strong id="EN-US_TOPIC_0000001098990696__b1816855971519">public.pgxc_copy_error_log</strong> table. For details about the table, see <a href="#EN-US_TOPIC_0000001098990696__table138318280213">Table 1</a>.</li><li id="EN-US_TOPIC_0000001098990696__li1512411314403">Create the B-tree index on the <strong id="EN-US_TOPIC_0000001098990696__b135320871811">relname</strong> column and execute <strong id="EN-US_TOPIC_0000001098990696__b9119105031815">REVOKE ALL on public.pgxc_copy_error_log FROM public</strong> to manage permissions for the error table (the permissions are the same as those of the <strong id="EN-US_TOPIC_0000001098990696__b125101127115716">COPY</strong> statement).</li><li id="EN-US_TOPIC_0000001098990696__li5133204153920"><strong id="EN-US_TOPIC_0000001098990696__b842352706192838">public.pgxc_copy_error_log</strong> is a row-store table. Therefore, this function can be executed and <strong id="EN-US_TOPIC_0000001098990696__b20431437105218">COPY FROM</strong> error tolerance is available only when row-store tables can be created in the cluster. After the GUC parameter <strong id="EN-US_TOPIC_0000001098990696__b16650193815012">enable_hadoop_env</strong> is enabled, row-based tables cannot be created in the cluster. The default value is <strong id="EN-US_TOPIC_0000001098990696__b1574011465506">off</strong>.</li><li id="EN-US_TOPIC_0000001098990696__li5455644164011">Same as the error table and the <strong id="EN-US_TOPIC_0000001098990696__b926604001123546">COPY</strong> statement, the function requires <strong id="EN-US_TOPIC_0000001098990696__b49211628678">sysadmin</strong> or higher permissions.</li><li id="EN-US_TOPIC_0000001098990696__li6684196134317">If the <strong id="EN-US_TOPIC_0000001098990696__b1424295211547">public.pgxc_copy_error_log</strong> table or the <strong id="EN-US_TOPIC_0000001098990696__b7244105275419">copy_error_log_relname_idx</strong> index already exists before the function creates it, the function will report an error and roll back.</li></ul>
</div></div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001098990696__table138318280213"></a><a name="table138318280213"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001098990696__table138318280213" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Error table public.pgxc_copy_error_log</caption><thead align="left"><tr id="EN-US_TOPIC_0000001098990696__row48415282214"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.1.28.4.2.4.1.1"><p id="EN-US_TOPIC_0000001098990696__p084142817211">Column</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.1.28.4.2.4.1.2"><p id="EN-US_TOPIC_0000001098990696__p198410281525">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.1.28.4.2.4.1.3"><p id="EN-US_TOPIC_0000001098990696__p08411281214">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001098990696__row65469159815"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p195466152819">relname</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p165477151182">varchar</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.28.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p3547141514816">Table name in the form of <em id="EN-US_TOPIC_0000001098990696__i1630782015259">Schema name</em><strong id="EN-US_TOPIC_0000001098990696__b266202317257">.</strong><em id="EN-US_TOPIC_0000001098990696__i1282582642516">Table name</em></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row984112817210"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p1882414211083">begintime</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p1082562116817">timestamp with time zone</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.28.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p17825921686">Time when a data format error was reported</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row148502818216"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p1935720521277">filename</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p1535785215711">character varying</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.28.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p10357155215713">Name of the source data file where a data format error occurs</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row1418810441476"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p2035812521178">rownum</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p12358205220716">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.28.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p2358105218712">Number of the row where a data format error occurs in a source data file</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row181905441873"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p6358185215718">rawrecord</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p153583521175">text</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.28.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p1135810527714">Raw record of a data format error in the source data file To prevent a field from being too long, the length of the field cannot exceed 1024 bytes.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001098990696__row1487854919720"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.1 "><p id="EN-US_TOPIC_0000001098990696__p9359145212719">detail</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.1.28.4.2.4.1.2 "><p id="EN-US_TOPIC_0000001098990696__p83592521276">text</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.1.28.4.2.4.1.3 "><p id="EN-US_TOPIC_0000001098990696__p20359105219717">Error details</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0000001098990696__li35096053518">pv_compute_pool_workload()<p id="EN-US_TOPIC_0000001098990696__p9514150133512"><a name="EN-US_TOPIC_0000001098990696__li35096053518"></a><a name="li35096053518"></a>Description: Provides the current load information about computing Node Groups on cloud.</p>
<p id="EN-US_TOPIC_0000001098990696__p35161207358">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li9293856164614">pg_stat_get_status(tid, num_node_display)<p id="EN-US_TOPIC_0000001098990696__p4797049515"><a name="EN-US_TOPIC_0000001098990696__li9293856164614"></a><a name="li9293856164614"></a>Description: Queries for the blocking and waiting status of the backend threads and auxiliary threads in the current instance. For details about the returned results, see the PG_THREAD_WAIT_STATUS view. The input parameters are described as follows:</p>
<ul id="EN-US_TOPIC_0000001098990696__ul2374015185110"><li id="EN-US_TOPIC_0000001098990696__li1437421545110"><strong id="EN-US_TOPIC_0000001098990696__b63524113510">tid</strong>: thread ID, which is of the bigint type. If this parameter is null, the waiting statuses of all backend threads and auxiliary threads are returned. Otherwise, only the waiting statuses of threads with the specified IDs are returned.</li><li id="EN-US_TOPIC_0000001098990696__li1042819276465"><strong id="EN-US_TOPIC_0000001098990696__b6908831135218">num_node_display</strong>: integer type. Specifies the maximum number of waiting nodes displayed in the <strong id="EN-US_TOPIC_0000001098990696__b788814254197">wait_status</strong> column for records whose waiting status is <strong id="EN-US_TOPIC_0000001098990696__b3940959171919">wait node</strong>.<ul id="EN-US_TOPIC_0000001098990696__ul11820184484619"><li id="EN-US_TOPIC_0000001098990696__li153591730184616">If this parameter is left empty or set to a value less than or equal to <strong id="EN-US_TOPIC_0000001098990696__b34014128234">0</strong>, only one waiting node is displayed.</li><li id="EN-US_TOPIC_0000001098990696__li4387333104617">If the value is greater than <strong id="EN-US_TOPIC_0000001098990696__b1092451992311">20</strong>, a maximum number of nodes can be displayed is <strong id="EN-US_TOPIC_0000001098990696__b280195312314">20</strong>.</li><li id="EN-US_TOPIC_0000001098990696__li93279360468">If the value is greater than <strong id="EN-US_TOPIC_0000001098990696__b1467381411265">0</strong> and less than or equal to <strong id="EN-US_TOPIC_0000001098990696__b15000181268">20</strong>, the smaller value between <strong id="EN-US_TOPIC_0000001098990696__b5689135092619">num_node_display</strong> and the actual number of waiting nodes is displayed. Use the <strong id="EN-US_TOPIC_0000001098990696__b992217182274">SELECT * from pg_stat_get_status(NULL, 10)</strong> query for example. If the number of waiting nodes is greater than <strong id="EN-US_TOPIC_0000001098990696__b1225142811273">10</strong>, the names of only 10 nodes are displayed randomly. If the number of waiting nodes is less than or equal to <strong id="EN-US_TOPIC_0000001098990696__b19571512913">10</strong>, the names of all waiting nodes are displayed. If the number of waiting nodes is greater than the number of displayed nodes, the displayed node names are randomly selected.</li></ul>
</li></ul>
<p id="EN-US_TOPIC_0000001098990696__p12621741164813">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li139990371388">pgxc_get_thread_wait_status(num_node_display)<p id="EN-US_TOPIC_0000001098990696__p258791751120"><a name="EN-US_TOPIC_0000001098990696__li139990371388"></a><a name="li139990371388"></a>Description: Queries for the call hierarchy between threads generated by all SQL statements on each node in a cluster, as well as the block waiting status of each thread. For details about the returned results, see the PGXC_THREAD_WAIT_STATUS view. The type and meaning of the input parameter <strong id="EN-US_TOPIC_0000001098990696__b10594194210310">num_node_display</strong> are the same as those of the <strong id="EN-US_TOPIC_0000001098990696__b929913494310">pg_stat_get_status</strong> function.</p>
<p id="EN-US_TOPIC_0000001098990696__p1784095120917">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li16454425125211">pgxc_os_run_info()<p id="EN-US_TOPIC_0000001098990696__p427219369212"><a name="EN-US_TOPIC_0000001098990696__li16454425125211"></a><a name="li16454425125211"></a>Description: Obtains the running status of the operating system on each node in a cluster. For details about the returned results, see "System Catalogs &gt; System Views &gt;PV_OS_RUN_INFO" in the <em id="EN-US_TOPIC_0000001098990696__i275694717420">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p91912411315">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li1445416252525">get_instr_wait_event()<p id="EN-US_TOPIC_0000001098990696__p1759191815187"><a name="EN-US_TOPIC_0000001098990696__li1445416252525"></a><a name="li1445416252525"></a>Description: Obtains the waiting status and events of the current instance. For details about the returned results, see "System Catalogs &gt; System Views &gt; GS_WAIT_EVENTS" in the <em id="EN-US_TOPIC_0000001098990696__i104784236513">Developer Guide</em>. If the GUC parameter <strong id="EN-US_TOPIC_0000001098990696__b3518201283010">enable_track_wait_event</strong> is <strong id="EN-US_TOPIC_0000001098990696__b18887191713306">off</strong>, this function returns <strong id="EN-US_TOPIC_0000001098990696__b92072456356">0</strong>.</p>
<p id="EN-US_TOPIC_0000001098990696__p18454182555215">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li24541725165215">pgxc_wait_events()<p id="EN-US_TOPIC_0000001098990696__p7207639181811"><a name="EN-US_TOPIC_0000001098990696__li24541725165215"></a><a name="li24541725165215"></a>Description: queries statistics about waiting status and events on each node in a cluster. For details about the returned results, see "System Catalogs &gt; System Views &gt; PGXC_WAIT_EVENTS" in the <em id="EN-US_TOPIC_0000001098990696__i810244010411">Developer Guide</em>. If the GUC parameter <strong id="EN-US_TOPIC_0000001098990696__b705185606">enable_track_wait_event</strong> is <strong id="EN-US_TOPIC_0000001098990696__b201929369">off</strong>, this function returns <strong id="EN-US_TOPIC_0000001098990696__b1319759311">0</strong>.</p>
<p id="EN-US_TOPIC_0000001098990696__p11454202511521">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li10454162514522">pgxc_stat_bgwriter()<p id="EN-US_TOPIC_0000001098990696__p1645532575220"><a name="EN-US_TOPIC_0000001098990696__li10454162514522"></a><a name="li10454162514522"></a>Description: queries statistics about backend write processes on each node in a cluster. For details about the returned results, see "System Catalogs &gt; System Views &gt; PG_STAT_BGWRITER" in the <em id="EN-US_TOPIC_0000001098990696__i553841125019">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p84553251521">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li945522514522">pgxc_stat_replication()<p id="EN-US_TOPIC_0000001098990696__p34553254528"><a name="EN-US_TOPIC_0000001098990696__li945522514522"></a><a name="li945522514522"></a>Description: queries information about the log synchronization status on each node in a cluster, such as the location where the logs are sent and received. For details about the returned results, see "System Catalogs &gt; System Views &gt; PG_STAT_REPLICATION" in the <em id="EN-US_TOPIC_0000001098990696__i2493181212534">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p1045518257527">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li154551259523">pgxc_replication_slots()<p id="EN-US_TOPIC_0000001098990696__p1045512512526"><a name="EN-US_TOPIC_0000001098990696__li154551259523"></a><a name="li154551259523"></a>Description: queries the replication status on each DN in a cluster. For details about the returned results, see "System Catalogs &gt; System Views &gt; PG_REPLICATION_SLOTS" in the <em id="EN-US_TOPIC_0000001098990696__i20516183725516">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p14551259529">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li345514256525">pgxc_settings()<p id="EN-US_TOPIC_0000001098990696__p1245552514525"><a name="EN-US_TOPIC_0000001098990696__li345514256525"></a><a name="li345514256525"></a>Description: queries information about runtime parameters on each node in a cluster. For details about the returned results, see "System Catalogs &gt; System Views &gt; PG_SETTINGS" in the <em id="EN-US_TOPIC_0000001098990696__i10142195719555">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p145522518526">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li7455825135217">pgxc_instance_time()<p id="EN-US_TOPIC_0000001098990696__p114559257523"><a name="EN-US_TOPIC_0000001098990696__li7455825135217"></a><a name="li7455825135217"></a>Description: queries the running time statistics of each node in a cluster and the time consumed in each execution phase. For details about the returned results, see "System Catalogs &gt; System Views &gt; PV_INSTANCE_TIME" in the <em id="EN-US_TOPIC_0000001098990696__i103280455587">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p184551125205210">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li144551725175212">pg_stat_get_redo_stat()<p id="EN-US_TOPIC_0000001098990696__p4455525115211"><a name="EN-US_TOPIC_0000001098990696__li144551725175212"></a><a name="li144551725175212"></a>Description: queries Xlog redo statistics on the current node. For details about the returned results, see "System Catalogs &gt; System Views &gt; PV_REDO_STAT" in the <em id="EN-US_TOPIC_0000001098990696__i2112440144215">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p2455162517529">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li845552515529">pgxc_redo_stat()<p id="EN-US_TOPIC_0000001098990696__p6455125115218"><a name="EN-US_TOPIC_0000001098990696__li845552515529"></a><a name="li845552515529"></a>Description: queries the Xlog redo statistics of each node in a cluster. For details about the returned results, see "System Catalogs &gt; System Views &gt; PV_REDO_STAT" in the <em id="EN-US_TOPIC_0000001098990696__i2039914993211">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p15455132512520">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li1345513252522">get_local_rel_iostat()<p id="EN-US_TOPIC_0000001098990696__p7455182575215"><a name="EN-US_TOPIC_0000001098990696__li1345513252522"></a><a name="li1345513252522"></a>Description: Obtains the disk I/O statistics of the current instance. For details about the returned results, see "System Catalogs &gt; System Views &gt; GS_REL_IOSTAT" in the <em id="EN-US_TOPIC_0000001098990696__i157036138114">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p1645512565219">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li10455925105213">pgxc_rel_iostat()<p id="EN-US_TOPIC_0000001098990696__p16455192517523"><a name="EN-US_TOPIC_0000001098990696__li10455925105213"></a><a name="li10455925105213"></a>Description: queries the disk I/O statistics on each node in a cluster. For details about the returned result, see "System Catalogs &gt; System Views &gt; GS_REL_IOSTAT" in the <em id="EN-US_TOPIC_0000001098990696__i146029451234">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p13455162535216">Return type: record</p>
</li><li id="EN-US_TOPIC_0000001098990696__li245552518521">get_node_stat_reset_time()<p id="EN-US_TOPIC_0000001098990696__p2455172515211"><a name="EN-US_TOPIC_0000001098990696__li245552518521"></a><a name="li245552518521"></a>Description: Obtains the time when statistics of the current instance were reset.</p>
<p id="EN-US_TOPIC_0000001098990696__p145612565218">Return type: timestamptz</p>
</li><li id="EN-US_TOPIC_0000001098990696__li17456925155211">pgxc_node_stat_reset_time()<p id="EN-US_TOPIC_0000001098990696__p1145620254523"><a name="EN-US_TOPIC_0000001098990696__li17456925155211"></a><a name="li17456925155211"></a>Description: queries the time when the statistics of each node in a cluster are reset. For details about the returned result, see "System Catalogs &gt; System Views &gt; GS_NODE_STAT_RESET_TIME" in the <em id="EN-US_TOPIC_0000001098990696__i1866584316413">Developer Guide</em>.</p>
<p id="EN-US_TOPIC_0000001098990696__p04561525105212">Return type: record</p>
<div class="note" id="EN-US_TOPIC_0000001098990696__note1042022135314"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><div class="p" id="EN-US_TOPIC_0000001098990696__p123339388162">When an instance is running, its statistics keep rising. In the following cases, the statistical values in the memory will be reset to <strong id="EN-US_TOPIC_0000001098990696__b5536183916429">0</strong>:<ul id="EN-US_TOPIC_0000001098990696__ul12456142519526"><li id="EN-US_TOPIC_0000001098990696__li54562250523">The instance is restarted or a cluster switchover occurs.</li><li id="EN-US_TOPIC_0000001098990696__li245612511523">The database is deleted.</li><li id="EN-US_TOPIC_0000001098990696__li164564259523">A reset operation is performed. For example, the statistics counter in the database is reset using the <strong id="EN-US_TOPIC_0000001098990696__b1448552994715">pgstat_recv_resetcounter</strong> function or the Unique SQL statements are cleared using the <strong id="EN-US_TOPIC_0000001098990696__b1068215362536">reset_instr_unique_sql</strong> function.</li></ul>
</div>
<p id="EN-US_TOPIC_0000001098990696__p8529105414160">If any of the preceding events occurs, <span id="EN-US_TOPIC_0000001098990696__text212614122172">GaussDB(DWS)</span> will record the time when the statistics are reset. You can query the time using the <strong id="EN-US_TOPIC_0000001098990696__b7383153535712">get_node_stat_reset_time</strong> function.</p>
</div></div>
</li></ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0052.html">System Administration Functions</a></div>
</div>
</div>