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

144 lines
24 KiB
HTML

<a name="EN-US_TOPIC_0000001233681601"></a><a name="EN-US_TOPIC_0000001233681601"></a>
<h1 class="topictitle1">Real-time Top SQL</h1>
<div id="body1500282066544"><p id="EN-US_TOPIC_0000001233681601__p654665313713">You can query real-time Top SQL in real-time resource monitoring views at different levels. The real-time resource monitoring view records the resource usage (including memory, data flushed to disks, and CPU time) and performance alarm information during job running.</p>
<p id="EN-US_TOPIC_0000001233681601__p1926013415223">The following table describes the external interfaces of the real-time views.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001233681601__table16116143418462"></a><a name="table16116143418462"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233681601__table16116143418462" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Real-time resource monitoring views</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233681601__row2269163474610"><th align="left" class="cellrowborder" valign="top" width="22.397760223977603%" id="mcps1.3.3.2.4.1.1"><p id="EN-US_TOPIC_0000001233681601__p8269434174616">Level</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.397760223977603%" id="mcps1.3.3.2.4.1.2"><p id="EN-US_TOPIC_0000001233681601__p1926911343463">Monitored Node</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.2044795520448%" id="mcps1.3.3.2.4.1.3"><p id="EN-US_TOPIC_0000001233681601__p8134194117326">View</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233681601__row152692034164618"><td class="cellrowborder" rowspan="2" valign="top" width="22.397760223977603%" headers="mcps1.3.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681601__p102691034154612">Query level/perf level</p>
</td>
<td class="cellrowborder" valign="top" width="22.397760223977603%" headers="mcps1.3.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681601__p32693347462">Current CN</p>
</td>
<td class="cellrowborder" valign="top" width="55.2044795520448%" headers="mcps1.3.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681601__p326915345461"><a href="dws_04_0706.html">GS_WLM_SESSION_STATISTICS</a></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681601__row13270113404615"><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681601__p1270734194614">All CNs</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681601__p13270203414462"><a href="dws_04_0841.html">PGXC_WLM_SESSION_STATISTICS</a></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681601__row227114349461"><td class="cellrowborder" rowspan="2" valign="top" width="22.397760223977603%" headers="mcps1.3.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681601__p1527143494613">Operator level</p>
</td>
<td class="cellrowborder" valign="top" width="22.397760223977603%" headers="mcps1.3.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681601__p4271123411465">Current CN</p>
</td>
<td class="cellrowborder" valign="top" width="55.2044795520448%" headers="mcps1.3.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001233681601__p162710344467"><a href="dws_04_0703.html">GS_WLM_OPERATOR_STATISTICS</a></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681601__row927116341462"><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001233681601__p927183474616">All CNs</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001233681601__p1427112347460"><a href="dws_04_0838.html">PGXC_WLM_OPERATOR_STATISTICS</a></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="EN-US_TOPIC_0000001233681601__n7a9652a1f8594abf8cd88b657df7f214"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001233681601__ul2046120281910"><li id="EN-US_TOPIC_0000001233681601__li1220725538">The view level is determined by the resource monitoring level, that is, the <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__section153571329142612">resource_track_level</a> configuration.</li><li id="EN-US_TOPIC_0000001233681601__li541810241581">The perf and operator levels affect the values of the <strong id="EN-US_TOPIC_0000001233681601__b196436624010">query_plan</strong> and <strong id="EN-US_TOPIC_0000001233681601__b12643363403">warning</strong> columns in <a href="dws_04_0706.html">GS_WLM_SESSION_STATISTICS</a>/<a href="dws_04_0839.html">PGXC_WLM_SESSION_INFO</a>. For details, see <a href="dws_04_0446.html">SQL Self-Diagnosis</a>.</li><li id="EN-US_TOPIC_0000001233681601__li5461102121920">Prefixes <strong id="EN-US_TOPIC_0000001233681601__b842352706112930">gs</strong> and <strong id="EN-US_TOPIC_0000001233681601__b842352706112934">pgxc</strong> indicate views showing single CN information and those showing cluster information, respectively. Common users can log in to a CN in the cluster to query only views with the <strong id="EN-US_TOPIC_0000001233681601__b09977810154">gs</strong> prefix.</li><li id="EN-US_TOPIC_0000001233681601__li9397175161910">When you query this type of views, there will be network latency, because the views obtain resource usage in real time.</li><li id="EN-US_TOPIC_0000001233681601__li11892347154112">If an instance fault occurs, some Top SQL statement information may fail to be recorded in real-time resource monitoring views.</li><li id="EN-US_TOPIC_0000001233681601__li12942257154712"><a name="EN-US_TOPIC_0000001233681601__li12942257154712"></a><a name="li12942257154712"></a>Top SQL statements are recorded in real-time resource monitoring views as follows:<ul id="EN-US_TOPIC_0000001233681601__ul103140232483"><li id="EN-US_TOPIC_0000001233681601__li1450152517548">Special DDL statements, such as <strong id="EN-US_TOPIC_0000001233681601__b153501524642">SET</strong>, <strong id="EN-US_TOPIC_0000001233681601__b11350124043">RESET</strong>, <strong id="EN-US_TOPIC_0000001233681601__b53508241420">SHOW</strong>, <strong id="EN-US_TOPIC_0000001233681601__b133512241644">ALTER SESSION SET</strong>, and <strong id="EN-US_TOPIC_0000001233681601__b83514243418">SET CONSTRAINTS</strong>, are not recorded.</li><li id="EN-US_TOPIC_0000001233681601__li9187131204818">DDL statements, such as <strong id="EN-US_TOPIC_0000001233681601__b128054261418">CREATE</strong>, <strong id="EN-US_TOPIC_0000001233681601__b138051261642">ALTER</strong>, <strong id="EN-US_TOPIC_0000001233681601__b280620261847">DROP</strong>, <strong id="EN-US_TOPIC_0000001233681601__b1480614267414">GRANT</strong>, <strong id="EN-US_TOPIC_0000001233681601__b98069261147">REVOKE</strong>, and <strong id="EN-US_TOPIC_0000001233681601__b0807626346">VACUUM</strong>, are recorded.</li><li id="EN-US_TOPIC_0000001233681601__li291031819217">DML statements are recorded, including:<ul id="EN-US_TOPIC_0000001233681601__ul1181627122110"><li id="EN-US_TOPIC_0000001233681601__li854324572112">the execution of <strong id="EN-US_TOPIC_0000001233681601__b19282125583515">SELECT</strong>, <strong id="EN-US_TOPIC_0000001233681601__b671485723510">INSERT</strong>, <strong id="EN-US_TOPIC_0000001233681601__b56761405365">UPDATE</strong>, and <strong id="EN-US_TOPIC_0000001233681601__b026312365">DELETE</strong></li><li id="EN-US_TOPIC_0000001233681601__li1735919495211">the execution of <strong id="EN-US_TOPIC_0000001233681601__b138450616580">EXPLAIN ANALYZE</strong> and <strong id="EN-US_TOPIC_0000001233681601__b719613138588">EXPLAIN PERFORMANCE</strong></li><li id="EN-US_TOPIC_0000001233681601__li1441016133813">the use of the query-level or perf-level views</li></ul>
</li><li id="EN-US_TOPIC_0000001233681601__li7710585482">The entry statements for invoking functions and stored procedures are recorded. When the GUC parameter <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__section7181949101319">enable_track_record_subsql</a> is enabled, some internal statements (except the <strong id="EN-US_TOPIC_0000001233681601__b1357135354316">DECLARE</strong> definition statement) of a stored procedure can be recorded. Only the internal statements delivered to DNs for execution are recorded, and the remaining internal statements are filtered out.</li><li id="EN-US_TOPIC_0000001233681601__li6414171018483">The anonymous block statement is recorded. When the GUC parameter <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__section7181949101319">enable_track_record_subsql</a> is enabled, some internal statements of an anonymous block can be recorded. Only the internal statements delivered to DNs for execution are recorded, and the remaining internal statements are filtered out.</li><li id="EN-US_TOPIC_0000001233681601__li13429101018253">The cursor statements are recorded. If a cursor does not read data from the cache but triggers the condition for delivering the statement to a DN for execution, the cursor statement is recorded and the statement and execution plan are enhanced. However, if the cursor reads data from the cache, the cursor statement is not recorded. When a cursor statement is used in an anonymous block or function and the cursor reads a large amount of data from a DN but is not fully used, the monitoring information about the cursor on the DN cannot be recorded due to the current architecture limitation. The <strong id="EN-US_TOPIC_0000001233681601__b627512212149">With Hold</strong> cursor syntax has a special execution logic. It executes queries during transaction committing. If a statement execution error is reported during this period of time, the <strong id="EN-US_TOPIC_0000001233681601__b14655154215387">aborted</strong> status of the job cannot be recorded in the TopSQL history table.</li><li id="EN-US_TOPIC_0000001233681601__li173571617104518">Statistics are not collected for jobs in the redistribution process.</li><li id="EN-US_TOPIC_0000001233681601__li1443820416409">The parameters of a statement with placeholders executed by JDBC are generally specified. However, if the length of the parameter and the original statement exceeds 64 KB, the parameter is not recorded. If the statement is a lightweight statement, it is directly delivered to the DN for execution and the parameter is not recorded.</li><li id="EN-US_TOPIC_0000001233681601__li167242653513">Scheduled task statements are not recorded. This function is supported only in versions later than 8.2.1.</li></ul>
</li></ul>
</div></div>
<div class="section" id="EN-US_TOPIC_0000001233681601__saa63a158e85e40e68a18bd4688ead5b4"><h4 class="sectiontitle">Prerequisites</h4><ul id="EN-US_TOPIC_0000001233681601__ubc04aa478573496d9f6b686ff3b65df7"><li id="EN-US_TOPIC_0000001233681601__lb9997f9dc8cf4ceba6645db629a401d7">The GUC parameter <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__s9530ecdd2b0d4a98b67b66e32bf8e5d0">enable_resource_track</a> is set to <strong id="EN-US_TOPIC_0000001233681601__b1634323194317">on</strong>. The default value is <strong id="EN-US_TOPIC_0000001233681601__b18341223204318">on</strong>.</li><li id="EN-US_TOPIC_0000001233681601__li1811301554419">The GUC parameter <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__section153571329142612">resource_track_level</a> is set to <strong id="EN-US_TOPIC_0000001233681601__b842352706182051">query</strong>, <strong id="EN-US_TOPIC_0000001233681601__b12406108143614">perf</strong>, or <strong id="EN-US_TOPIC_0000001233681601__b842352706182054">operator</strong>. The default value is <strong id="EN-US_TOPIC_0000001233681601__b842352706182059">query</strong>.</li><li id="EN-US_TOPIC_0000001233681601__li1971045485">Job monitoring rules are as follows:<ul id="EN-US_TOPIC_0000001233681601__ul1955111017919"><li id="EN-US_TOPIC_0000001233681601__li85518102919">Jobs whose execution cost estimated by the optimizer is greater than or equal to <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__section1089022732713">resource_track_cost</a>.</li></ul>
</li><li id="EN-US_TOPIC_0000001233681601__ldef0eb69efa7404ba3c18ccfdc671f6a">If the Cgroups function is properly loaded, you can run the <strong id="EN-US_TOPIC_0000001233681601__b1268014288479">gs_cgroup -P</strong> command to view information about Cgroups.</li><li id="EN-US_TOPIC_0000001233681601__li910732919536">The GUC parameter <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__section7181949101319">enable_track_record_subsql</a> specifies whether to record internal statements of a stored procedure or anonymous block.</li></ul>
<p id="EN-US_TOPIC_0000001233681601__p192091357195311">In the preceding prerequisites, <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__s9530ecdd2b0d4a98b67b66e32bf8e5d0">enable_resource_track</a> is a system-level parameter that specifies whether to enable resource monitoring. <a href="dws_04_0922.html#EN-US_TOPIC_0000001233563121__section153571329142612">resource_track_level</a> is a session-level parameter. You can set the resource monitoring level of a session as needed. The following table describes the values of the two parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001233681601__table874434715481"></a><a name="table874434715481"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233681601__table874434715481" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Setting the resource monitoring level to collect statistics</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233681601__row1782164764814"><th align="left" class="cellrowborder" valign="top" width="30.39%" id="mcps1.3.5.4.2.5.1.1"><p id="EN-US_TOPIC_0000001233681601__p5821947134818">enable_resource_track</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="29.270000000000003%" id="mcps1.3.5.4.2.5.1.2"><p id="EN-US_TOPIC_0000001233681601__p12821144724815">resource_track_level</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.830000000000002%" id="mcps1.3.5.4.2.5.1.3"><p id="EN-US_TOPIC_0000001233681601__p108212047154815">Query-Level Information</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.509999999999998%" id="mcps1.3.5.4.2.5.1.4"><p id="EN-US_TOPIC_0000001233681601__p1821194714489">Operator-Level Information</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233681601__row2082115471488"><td class="cellrowborder" rowspan="4" valign="top" width="30.39%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681601__p1582314712480">on(default)</p>
</td>
<td class="cellrowborder" valign="top" width="29.270000000000003%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681601__p88231547194811">none</p>
</td>
<td class="cellrowborder" valign="top" width="20.830000000000002%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681601__p1682314744812">Not collected</p>
</td>
<td class="cellrowborder" valign="top" width="19.509999999999998%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681601__p2823114724816">Not collected</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681601__row8823104754813"><td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681601__p15823104710485">query(default)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681601__p78236476485">Collected</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681601__p1782312479480">Not collected</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681601__row1721717445116"><td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681601__p62171044151115">perf</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681601__p17217164451112">Collected</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681601__p16217124471113">Not collected</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681601__row128231477483"><td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681601__p882394754817">operator</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681601__p582317473486">Collected</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681601__p58231247164818">Collected</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681601__row1182384712487"><td class="cellrowborder" valign="top" width="30.39%" headers="mcps1.3.5.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681601__p19823114724815">off</p>
</td>
<td class="cellrowborder" valign="top" width="29.270000000000003%" headers="mcps1.3.5.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681601__p148231647184820">none/query/operator</p>
</td>
<td class="cellrowborder" valign="top" width="20.830000000000002%" headers="mcps1.3.5.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681601__p1882317479487">Not collected</p>
</td>
<td class="cellrowborder" valign="top" width="19.509999999999998%" headers="mcps1.3.5.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681601__p19823174794812">Not collected</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001233681601__sedaa25b8495d4cb9ab8805916ec54d43"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001233681601__o0e362c38e9114b84a7d726ebf9c31299"><li id="EN-US_TOPIC_0000001233681601__l3436d26fb27a4c0b99ef4871df1d1190"><span>Query for the real-time CPU information in the <strong id="EN-US_TOPIC_0000001233681601__b1835482117489">gs_session_cpu_statistics</strong> view.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__s5064e257bf524899811bc00deb24263e"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_session_cpu_statistics</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li><li id="EN-US_TOPIC_0000001233681601__l5dadd686e5e54eea92acceb0453c06cc"><span>Query for the real-time memory information in the <strong id="EN-US_TOPIC_0000001233681601__b54545422478">gs_session_memory_statistics</strong> view.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__s0a043415e5f24cbfa14b931c1cfae1cb"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_session_memory_statistics</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li><li id="EN-US_TOPIC_0000001233681601__l546512205edb426780ce8a9d3afd6d45"><span>Query for the real-time resource information about the current CN in the <strong id="EN-US_TOPIC_0000001233681601__b7800141244717">gs_wlm_session_statistics</strong> view.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__saa5937f152e644e0bd3ebaf47805e1a5"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_session_statistics</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li><li id="EN-US_TOPIC_0000001233681601__l1ec2d6e86b894dd3b1c2e8f9d318be89"><span>Query for the real-time resource information about all CNs in the <strong id="EN-US_TOPIC_0000001233681601__b7878851144612">pgxc_wlm_session_statistics</strong> view.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__s27fee00824544e709ed0948738c5d511"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pgxc_wlm_session_statistics</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li><li id="EN-US_TOPIC_0000001233681601__li6506636184212"><span>Query for the real-time resource information about job operators on the current CN in the <strong id="EN-US_TOPIC_0000001233681601__b35695198463">gs_wlm_operator_statistics</strong> view.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__screen13508193611424"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_operator_statistics</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li><li id="EN-US_TOPIC_0000001233681601__li16168124584215"><span>Query for the real-time resource information about job operators on all CNs in the <strong id="EN-US_TOPIC_0000001233681601__b6527657184514">pgxc_wlm_operator_statistics</strong> view.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__screen102271236181310"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pgxc_wlm_operator_statistics</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li><li id="EN-US_TOPIC_0000001233681601__li6227153691312"><span>Query for the load management information about the jobs executed by the current user in the <strong id="EN-US_TOPIC_0000001233681601__b1942523435">PG_SESSION_WLMSTAT</strong> view.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__screen16280113181415"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_session_wlmstat</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li><li id="EN-US_TOPIC_0000001233681601__li1128041391410"><span>Query the job execution status of the current user on each CN in the <strong id="EN-US_TOPIC_0000001233681601__b783008183417">pgxc_wlm_workload_records</strong> view (this view is available when the dynamic load function is enabled, that is, <strong id="EN-US_TOPIC_0000001233681601__b1283116873420">enable_dynamic_workload</strong> is set to <strong id="EN-US_TOPIC_0000001233681601__b68319863417">on</strong>).</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001233681601__screen128010136142"><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="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pgxc_wlm_workload_records</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0393.html">Resource Monitoring</a></div>
</div>
</div>