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

236 lines
28 KiB
HTML

<a name="EN-US_TOPIC_0000001188642076"></a><a name="EN-US_TOPIC_0000001188642076"></a>
<h1 class="topictitle1">PGXC_STAT_ACTIVITY</h1>
<div id="body1543482317963"><p id="EN-US_TOPIC_0000001188642076__p8060118"><strong id="EN-US_TOPIC_0000001188642076__b19695123224">PGXC_STAT_ACTIVITY</strong> displays information about the query performed by the current user on all the CNs in the current cluster.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188642076__t0b125cfdf0024bfbb02649cae07a45be" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PGXC_STAT_ACTIVITY columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188642076__rebf63823929b4cb8a55bf5436bd1fb28"><th align="left" class="cellrowborder" valign="top" width="27.939999999999998%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188642076__a0eab7249f5cb409e8bfbf7054b050053">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.41%" id="mcps1.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188642076__a647fe13e210e4946878cb087798148c5">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.65%" id="mcps1.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188642076__ad55f85462ff14cf9b3115cc2ea91861a">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188642076__row75571432104516"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__p25581632104518">coorname</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__p75587322453">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__p1372704910507">Name of the CN in the current cluster</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r8c3116f825074e608084670ac5b70a2a"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a9b116edff0654771970234c248ede18f">datid</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a9b525181d8fb428e9ead1638711bbcd7">oid</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__aebfa8191a7f04d0fad4a7d07ba573eec">OID of the database that the user session connects to in the backend</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r9bf718f20973455691b1d4317b050e1b"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a339dcd77da9d44ac84a46f34bd3792b3">datname</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__ab11d18e5f3c6411c8c2a1a92f60877cc">name</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a72f8906b1b2d464c8b3f16c093f6eee6">Name of the database that the user session connects to in the backend</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r5d0bdfb1ac844b94976256998ef29fa3"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a70f60fe3386e4c0aa2c7eb6f46911875">pid</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a31b426cab42e40a6b0165c1daa9eb9ae">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a4aceec31e08f41a88e66706eeaab9936">ID of the backend thread</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__row580817136919"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__p118087139918">lwtid</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__p28084133919">integer</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__p080810137913">Lightweight thread ID of the backend thread</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__re8080d88e3624deeb7e6f2072cd78d26"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a14d17c6c513e4aa99102c8279d3b63b0">usesysid</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a25bbdd2f69564d0b90a3f020220f2c06">oid</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__afd0cab960c5a4760810025c623445744">OID of the user logging in to the backend</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r34005b6fd20a438d8c4b95c9750765c4"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__ac19daae36a4a4904926dc196251754a2">usename</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__aabd71c74cfd844e58e015e0698243c8c">name</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a9838da23292141aea59a57d19544d7c8">Name of the user logging in to the backend</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r97db8eecad4748a2aacfcdbd72302fcf"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a32a8c157fb70409c892df4429f031400">application_name</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__af27f30dd1f724852890c03aba51118af">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__ad0189ff1387246f8b7738ff206f639d5">Name of the application connected to the backend</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__rd378398bd1824bd9ae04233e47ac1713"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__ac181d66b093b4915bcac410e3fa6250a">client_addr</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__ad2a76237a3424cafa331e16f1b85da32">inet</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a605791179f034b8a9f25ddbb122ac204">IP address of the client connected to the backend. If this column is <strong id="EN-US_TOPIC_0000001188642076__b3927414183717">null</strong>, it indicates either that the client is connected via a Unix socket on the server machine or that this is an internal process such as autovacuum.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__re047a4263aab4dc39e7d3155d0e8b0b8"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__aebbc39eaa8f34482847ed83ae107cdf2">client_hostname</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a0fbed1b8ddf54acb812557ec945a2ddc">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a8c84f1af82a44c2f9a4836634a9f3275">Host name of the connected client, as reported by a reverse DNS lookup of <strong id="EN-US_TOPIC_0000001188642076__b842352706142331">client_addr</strong>. This column will only be non-null for IP connections, and only when <strong id="EN-US_TOPIC_0000001188642076__b842352706142349">log_hostname</strong> is enabled.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r6c46ff37ed6940839fdc55533e2d439a"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__en-us_topic_0059777972_p182025232120">client_port</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__en-us_topic_0059777972_p620213232017">integer</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__en-us_topic_0059777972_p02031923418">TCP port number that the client uses for communication with this backend, or <strong id="EN-US_TOPIC_0000001188642076__b842352706105354">-1</strong> if a Unix socket is used</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r45dbe1f4eabf46af996ff7ed5992fca7"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__abb3909e7ea1347d28be3179bba30180f">backend_start</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a20aa9177c3eb4ca6bd2a9541dad4ac5b">timestamp with time zone</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__ac73d1ecc34594aa9a0449e36c298b5c1">Startup time of the backend process, that is, the time when the client connects to the server</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r19168a43329c4d3fb96fea94d14aebb7"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__ae4180a4253dc47e6851d078a61e34495">xact_start</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a0ac15a41f69b47c384c02e11421312ff">timestamp with time zone</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__aace3ba2ecf694787ad19f9a4584c14fe">Time when the current transaction was started, or <strong id="EN-US_TOPIC_0000001188642076__b346512134516">NULL</strong> if no transaction is active. If the current query is the first of its transaction, this column is equal to the <strong id="EN-US_TOPIC_0000001188642076__en-us_topic_0058965573_b842352706143320">query_start</strong> column.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r7d81c20f5e1b45c281dacd6fdaf13d4b"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a3e33eb58aa734733893da079582871eb">query_start</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__ae8b5bc2d3730445a9c9c7562dec56af3">timestamp with time zone</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a2b44eb54f7a347edbf142d81a53620aa">Time when the currently active query was started, or time when the last query was started if <strong id="EN-US_TOPIC_0000001188642076__b842352706143652">state</strong> is not <strong id="EN-US_TOPIC_0000001188642076__b842352706143657">active</strong></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__ree51e24d5d434fd5b9133f73b54acc1f"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__en-us_topic_0059777972_p123781246012">state_change</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__ab60f329d604146d48b7a11c04d36d046">timestamp with time zone</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__en-us_topic_0059777972_p737818248020">Time for the last status change</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r4d6326ba27eb42a4b3d43da81ce0a396"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a8514533a96d147bdbd8a5acab6afb8f6">waiting</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a62007985fb4a4da4a0cbb78f21294ea8"><span id="EN-US_TOPIC_0000001188642076__text2360115415373">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a6643a45e0df04ffa9be7e64e3a4d4caa">The value is <strong id="EN-US_TOPIC_0000001188642076__b1218565062414">t</strong> if the backend is currently waiting for a lock or node. Otherwise, the value is <strong id="EN-US_TOPIC_0000001188642076__b01851050112419">f</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r939b7efd612848888f59b136c9af2e74"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__abdd05d2dc6724b768fee46c35347ed86">enqueue</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__af97ed5bcdd8b4dccba45a01a2892742c">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a7d7c7e9c1311411ea2229e6e20c2c0ab">Queuing status of a statement. Its value can be: </p>
<ul id="EN-US_TOPIC_0000001188642076__ul1254815291343"><li id="EN-US_TOPIC_0000001188642076__li15408711105013"><strong id="EN-US_TOPIC_0000001188642076__b18253544766">waiting in global queue</strong>: The statement is in the global concurrent queues.</li><li id="EN-US_TOPIC_0000001188642076__li13626184101816"><strong id="EN-US_TOPIC_0000001188642076__b3414535101015">waiting in respool queue</strong>: The statement is queuing in the resource pool. The scenarios are as follows:<ol id="EN-US_TOPIC_0000001188642076__ol063242011556"><li id="EN-US_TOPIC_0000001188642076__li14632120125520">When dynamic load balancing is enabled, the number of simple jobs exceeds the upper limit (<strong id="EN-US_TOPIC_0000001188642076__b145271353151016">max_dop</strong>) of concurrent jobs on the fast lane.</li><li id="EN-US_TOPIC_0000001188642076__li663213204557">When dynamic load balancing is disabled, the number of simple jobs exceeds the upper limit (<strong id="EN-US_TOPIC_0000001188642076__b1534154201113">max_dop</strong>) of concurrent jobs on the fast lane or the number of complex jobs exceeds the upper limit of concurrent jobs on the slow lane.</li></ol>
</li></ul>
<ul id="EN-US_TOPIC_0000001188642076__ul985981475020"><li id="EN-US_TOPIC_0000001188642076__li7859131416508"><strong id="EN-US_TOPIC_0000001188642076__b64002018151118">waiting in ccn queue</strong>: The job is in the CCN queue, which may be global memory queuing, slow lane memory queuing, or concurrent queuing.</li><li id="EN-US_TOPIC_0000001188642076__li4859814195013">Empty or <strong id="EN-US_TOPIC_0000001188642076__b17247023304159">no waiting queue</strong>: The statement is running.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r5bb8f467631340228ec94c56284b233d"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a1a358297407f4e4e99649d63d11192f2">state</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__ae58bc6c7ebc34c2ab735858242a76146">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a88c42e9c9db241fbb08b27e3c05ccae7">Overall state of the backend. Its value can be: </p>
<ul id="EN-US_TOPIC_0000001188642076__u22ea175e21e24aa4a9b69b2aa51d24ca"><li id="EN-US_TOPIC_0000001188642076__l558408e2a7c54bd287712e64867eb50a"><strong id="EN-US_TOPIC_0000001188642076__b842352706143919">active</strong>: The backend is executing a query.</li><li id="EN-US_TOPIC_0000001188642076__lfede9fcd77e74b55aef4e8a5e0781ed7"><strong id="EN-US_TOPIC_0000001188642076__b842352706143934">idle</strong>: The backend is waiting for a new client command.</li><li id="EN-US_TOPIC_0000001188642076__lefa211d536f64bf3bd48b6dd34251da4"><strong id="EN-US_TOPIC_0000001188642076__b69051320144012">idle in transaction</strong>: The backend is in a transaction, but there is no statement being executed in the transaction.</li><li id="EN-US_TOPIC_0000001188642076__l8b7410d503d342af9ee381bffebebd81"><strong id="EN-US_TOPIC_0000001188642076__b231562604012">idle in transaction (aborted)</strong>: The backend is in a transaction, but there are statements failed in the transaction.</li><li id="EN-US_TOPIC_0000001188642076__laae633cf42f349a79196ebc875c0932e"><strong id="EN-US_TOPIC_0000001188642076__b84235270615746">fastpath function call</strong>: The backend is executing a <strong id="EN-US_TOPIC_0000001188642076__b1110241117412">fast-path</strong> function.</li><li id="EN-US_TOPIC_0000001188642076__l2909ade615ce40bf8bff29699e7cd21b"><strong id="EN-US_TOPIC_0000001188642076__b84235270615814">disabled</strong>: This state is reported if <strong id="EN-US_TOPIC_0000001188642076__b84235270615825">track_activities</strong> is disabled in this backend.</li></ul>
<div class="note" id="EN-US_TOPIC_0000001188642076__note191674411848"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000001188642076__p2167841046">Only system administrators can view the session status of their accounts. The state information of other accounts is empty.</p>
</div></div>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r2be3fc6e9de54f9b98eb1f68dbbc920a"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a5bd3356a8381483983e64d3acf9f6ee3">resource_pool</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a7dbee4294c0f4c57afe9e2c880ed3c79">name</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a41710708fa1742c1b07f77ce38846351">Resource pool used by the user</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__row9114475104"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__p6117476107">stmt_type</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__p31110476106">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__p01115478102">Type of a user statement</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r036b0f643b114c08ba91ea9323b1a3e0"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a07d1ccc0600d439c8c2d9ff0ec27dd82">query_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__a3d1f5d0257cc4e4fa1d43f56ba016739">bigint</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a81eb38f540064a768c81dda2b77d986e">ID of a query</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__r7a78e8a918eb4ac798612e31ddca2b86"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__a15a6b17cc75748a9b778090464506f03">query</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__en-us_topic_0059777972_p16721563586">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__a6b71e992530b4766ade8551f1216fda2">Text of this backend's most recent query If the <strong id="EN-US_TOPIC_0000001188642076__en-us_topic_0058965573_b842352706215251">state</strong> is <strong id="EN-US_TOPIC_0000001188642076__en-us_topic_0058965573_b842352706215249">active</strong>, this column shows the executing query. In all other states, it shows the last query that was executed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642076__row16775213184612"><td class="cellrowborder" valign="top" width="27.939999999999998%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188642076__p13120145515310">connection_info</p>
</td>
<td class="cellrowborder" valign="top" width="20.41%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188642076__p1412065518316">text</p>
</td>
<td class="cellrowborder" valign="top" width="51.65%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188642076__p1612017551314">A string in JSON format recording the driver type, driver version, driver deployment path, and process owner of the connected database (for details, see <a href="dws_04_0889.html#EN-US_TOPIC_0000001188482316__section4834457114318">connection_info</a>)</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642076__section791293410443"><h4 class="sectiontitle">Example</h4><p id="EN-US_TOPIC_0000001188642076__p9912113411443">Run the following command to view blocked query statements.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188642076__screen11912173464419"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">datname</span><span class="p">,</span><span class="n">usename</span><span class="p">,</span><span class="k">state</span><span class="p">,</span><span class="n">query</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">PGXC_STAT_ACTIVITY</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">waiting</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">true</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001188642076__p19120341441">Check the working status of the snapshot thread.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188642076__screen1691283444415"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">application_name</span><span class="p">,</span><span class="n">backend_start</span><span class="p">,</span><span class="n">state_change</span><span class="p">,</span><span class="k">state</span><span class="p">,</span><span class="n">query</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">PGXC_STAT_ACTIVITY</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">application_name</span><span class="o">=</span><span class="s1">'WDRSnapshot'</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001188642076__p169121034144420">View the running query statements.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188642076__screen49123342448"><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">datname</span><span class="p">,</span><span class="n">usename</span><span class="p">,</span><span class="k">state</span><span class="p">,</span><span class="n">pid</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">PGXC_STAT_ACTIVITY</span><span class="p">;</span>
<span class="w"> </span><span class="n">datname</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">usename</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">state</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">pid</span>
<span class="c1">----------+---------+--------+-----------------</span>
<span class="w"> </span><span class="n">gaussdb</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Ruby</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">active</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">140298793514752</span>
<span class="w"> </span><span class="n">gaussdb</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Ruby</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">active</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">140298718004992</span>
<span class="w"> </span><span class="n">gaussdb</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Ruby</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">idle</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">140298650908416</span>
<span class="w"> </span><span class="n">gaussdb</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Ruby</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">idle</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">140298625742592</span>
<span class="w"> </span><span class="n">gaussdb</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">dbadmin</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">active</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">140298575406848</span>
<span class="p">(</span><span class="mi">5</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001188642076__p49141334104416">View the number of session connections that have been used by postgres. <strong id="EN-US_TOPIC_0000001188642076__b1405496447">1</strong> indicates the number of session connections that have been used by <strong id="EN-US_TOPIC_0000001188642076__b1141269104418">postgres</strong>.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188642076__screen19914934194416"><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></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="k">COUNT</span><span class="p">(</span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">PGXC_STAT_ACTIVITY</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">DATNAME</span><span class="o">=</span><span class="s1">'postgres'</span><span class="p">;</span>
<span class="w"> </span><span class="k">count</span><span class="w"> </span>
<span class="c1">-------</span>
<span class="w"> </span><span class="mi">1</span>
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0639.html">System Views</a></div>
</div>
</div>