forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
39 lines
15 KiB
HTML
39 lines
15 KiB
HTML
<a name="EN-US_TOPIC_0000001924569276"></a><a name="EN-US_TOPIC_0000001924569276"></a>
|
||
|
||
<h1 class="topictitle1">SQL Diagnosis</h1>
|
||
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001924569276__section319918146483"><h4 class="sectiontitle">Prerequisites</h4><p id="EN-US_TOPIC_0000001924569276__p1251662120482">To enable SQL diagnosis, enable monitoring on real-time and historical queries on the <strong id="EN-US_TOPIC_0000001924569276__b207191545794">Queries</strong> and <strong id="EN-US_TOPIC_0000001924569276__b271913451917">History</strong> tabs, respectively. For details, see <a href="dws_01_00135.html#EN-US_TOPIC_0000001924728812__en-us_topic_0000001076708691_section149871230683">Monitoring Collection</a>.</p>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_section754243519236"><h4 class="sectiontitle">Viewing SQL Diagnosis</h4><ol id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ol1482535782316"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li3826105742313"><span>Log in to the GaussDB(DWS) management console.</span></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li1382685717234"><span>On the <strong id="EN-US_TOPIC_0000001924569276__b1168511372202">Clusters</strong> > <strong id="EN-US_TOPIC_0000001924569276__b66853373205">Dedicated Clusters<span id="EN-US_TOPIC_0000001924569276__text1195651183716"></span></strong> page, locate the cluster to be monitored.</span></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li118261257172315"><span>In the <strong id="EN-US_TOPIC_0000001924569276__b1784718245597">Operation</strong> column of the target cluster, click <strong id="EN-US_TOPIC_0000001924569276__b18848124155911">Monitoring Panel</strong>.</span></li><li id="EN-US_TOPIC_0000001924569276__li645764432318"><span>In the navigation pane on the left, choose <strong id="EN-US_TOPIC_0000001924569276__b711712314515">Utilities</strong> > <strong id="EN-US_TOPIC_0000001924569276__b788033654518">SQL Diagnosis</strong>. The metrics include:</span><p><ul id="EN-US_TOPIC_0000001924569276__ul1153203522418"><li id="EN-US_TOPIC_0000001924569276__li35324352248">Query ID</li><li id="EN-US_TOPIC_0000001924569276__li115321835142416">Database</li><li id="EN-US_TOPIC_0000001924569276__li18532163515240">Schema Name</li><li id="EN-US_TOPIC_0000001924569276__li35330356248">User Name</li><li id="EN-US_TOPIC_0000001924569276__li0533135122419">Client</li><li id="EN-US_TOPIC_0000001924569276__li16533153513249">Client IP Address</li><li id="EN-US_TOPIC_0000001924569276__li2533193515249">Running Time (ms)</li><li id="EN-US_TOPIC_0000001924569276__li5533113510247">CPU Time (ms)</li><li id="EN-US_TOPIC_0000001924569276__li18534235182412">Scale-Out Started</li><li id="EN-US_TOPIC_0000001924569276__li553423520248">Completed</li><li id="EN-US_TOPIC_0000001924569276__li1553493518248">Details</li></ul>
|
||
</p></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li8826165722320"><span>On the <strong id="EN-US_TOPIC_0000001924569276__b114256187541226">SQL Diagnosis</strong> page, you can view the SQL diagnosis information. In the <strong id="EN-US_TOPIC_0000001924569276__b85696733441226">Details</strong> column of a specified query ID, click <strong id="EN-US_TOPIC_0000001924569276__b184726947641226">View</strong> to view the detailed SQL diagnosis result, including:</span><p><ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul1826185742314"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li28261157122311">Alarm Information</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li12826135712318">SQL Statement</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li5826175710232">Execution Plan</li></ul>
|
||
<p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p4827185742312"></p>
|
||
</p></li></ol>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_section3665174263916"><a name="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_section3665174263916"></a><a name="en-us_topic_0000001076708521_section3665174263916"></a><h4 class="sectiontitle">Setting GUC Parameters</h4><p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p13607195214215">GUC parameters related to SQL diagnosis are as follows. For details, see "GUC Parameters" in the <em id="EN-US_TOPIC_0000001924569276__i921403194914">Data Warehouse Service (DWS) Developer Guide</em>.</p>
|
||
<ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul7398112214435"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li1039862211433"><strong id="EN-US_TOPIC_0000001924569276__b1263020504301">enable_resource_track</strong><ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul202211650124615"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li5317031194713">Value range: boolean</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li122811949467">Default value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b93482320537">on</strong></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li162811140461">Expected DMS value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b185636561487">on</strong> (for reference only)</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li152812434616">Function: Specifies whether to enable the real-time resource monitoring function.<div class="notice" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_note123131752102517"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p93131252112515">If this parameter is enabled without other GUC-related parameters correctly configured, real-time resource consumption cannot be recorded.</p>
|
||
</div></div>
|
||
</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li7398322174317"><strong id="EN-US_TOPIC_0000001924569276__b2947115723813">resource_track_cost</strong><ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul7398132284315"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li239813223439">Value range: an integer ranging from –1 to INT_MAX</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li21884511488">Default value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b569231115413">100000</strong></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li5398112244318">Expected DMS value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b14139151515420">0</strong> (for reference only)</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li157155259447">Function: Specifies the minimum execution cost of statement resource monitoring for the current session. This parameter is valid only when <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b155164925518">enable_resource_track</strong> is <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b4168155110550">on</strong>.<div class="notice" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_note1572611109254"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p11726151012519">If this parameter is set to a small value, more statements will be recorded, causing record expansion and affecting cluster performance.</p>
|
||
</div></div>
|
||
</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li1539862218434"><strong id="EN-US_TOPIC_0000001924569276__b175171235153919">resource_track_level</strong><ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul839812212439"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li123706145215">Value range: enumerated type</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li13457165345112">Default value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b22601016135619">query</strong></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li13398172284314">Expected DMS value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b167885605616">query</strong> (for reference only)</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li939862212431">Function: Specifies the resource monitoring level for the current session. This parameter is valid only when <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b131216113571">enable_resource_track</strong> is <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b1197781410571">on</strong>.<div class="notice" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_note177951620112715"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p37961120132717">If the resource monitoring is set to operator-level, performance will be greatly affected.</p>
|
||
</div></div>
|
||
</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li113990225430"><strong id="EN-US_TOPIC_0000001924569276__b174777293433">resource_track_duration</strong><ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul5399192219438"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li117094186536">Value range: an integer ranging from 0 to INT_MAX, in seconds</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li1739910224431">Default value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b248432617582">60</strong>.</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li03997221439">Expected DMS value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b9711143318580">0</strong> (for reference only)</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li93999225432">Function: Specifies the minimum statement execution time that determines whether information about jobs of a statement recorded in the real-time view will be dumped to a historical view after the statement is executed. That is, only statements whose execution time exceeds the specified time are recorded in the historical view. This parameter is valid only when <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b10990522151">enable_resource_track</strong> is <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b49944221657">on</strong>.<div class="notice" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_note3671193717277"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p9692103732718">If this parameter is set to a small value, the batch processing mechanism for dumping kernel statements becomes invalid, affecting the kernel performance.</p>
|
||
</div></div>
|
||
</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li193991922194314"><strong id="EN-US_TOPIC_0000001924569276__b16841030184413">topsql_retention_time</strong><ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul43990225434"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li19601622135412">Value range: an integer ranging from 0 to 3650, in days</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li1539922214315">Default value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b113471159854">30</strong></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li9399122114314">Expected DMS value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b1498612181963">14</strong> (for reference only)</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li7399422104318">Function: Specifies the aging time of <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b61309324619">pgxc_wlm_session_info</strong> data in the view.<div class="notice" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_note46231565297"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p56452062292">If this parameter is set to <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b178808441266">0</strong>, data will not be aged, which will cause storage expansion.</p>
|
||
</div></div>
|
||
</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li1739919228434"><strong id="EN-US_TOPIC_0000001924569276__b19445172317459">enable_resource_record</strong><ul id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_ul1839972264315"><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li1354205155511">Value range: boolean</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li239972217437">Default value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b157860521666">off</strong></li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li14399132274320">Expected DMS value: <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b131801582620">on</strong> (for reference only)</li><li id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_li193991122154314">Function: Specifies whether to enable the archiving function for resource monitoring records. When this function is enabled, records in the history views (<strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b1986311017911">GS_WLM_SESSION_HISTORY</strong> and <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b119821538915">GS_WLM_OPERATOR_HISTORY</strong>) are archived to the info views (<strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b2893291093">GS_WLM_SESSION_INFO</strong> and <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b16774812598">GS_WLM_OPERATOR_INFO</strong>) every 3 minutes. After the archiving, records in the history views are deleted.<div class="notice" id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_note42186208303"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_p14911102714305">When this parameter is enabled, you are advised to set <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b1297917372303">topsql_retention_time</strong> properly to configure the aging time. Otherwise, data in the <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b56665711312">GS_WLM_SESSION_INFO</strong> or <strong id="EN-US_TOPIC_0000001924569276__en-us_topic_0000001076708521_b14234211133118">GS_WLM_OPERATOR_INFO</strong> table will expand.</p>
|
||
</div></div>
|
||
</li></ul>
|
||
</li></ul>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_01_00175.html">Utilities</a></div>
|
||
</div>
|
||
</div>
|
||
|