Yang, Tong 48706b7552 MRS COMP-LTS 320-lts.1 version
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2024-04-12 12:51:10 +00:00

26 lines
8.8 KiB
HTML

<a name="mrs_01_24838"></a><a name="mrs_01_24838"></a>
<h1 class="topictitle1">Using HetuEngine SQL Diagnosis</h1>
<div id="body32001227"><p id="mrs_01_24838__en-us_topic_0000001470319382_p197981831005">This section applies to MRS 3.2.0 or later.</p>
<div class="section" id="mrs_01_24838__en-us_topic_0000001470319382_section9753111417"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_24838__en-us_topic_0000001470319382_p2413163012277">The <span id="mrs_01_24838__en-us_topic_0000001470319382_text68803878254248">HetuEngine</span> QAS module provides automatic detection, learning, and diagnosis of historical SQL execution records for more efficient online SQL O&amp;M and faster online SQL analysis. After SQL diagnosis is enabled, the system provides the following capabilities:</p>
<ul id="mrs_01_24838__en-us_topic_0000001470319382_ul1750802814365"><li id="mrs_01_24838__en-us_topic_0000001470319382_li17508828133612">Automatically detects and displays tenant-level and user-level SQL execution statistics in different time periods to cluster administrators, helping them quickly predict service running status and potential risks.</li><li id="mrs_01_24838__en-us_topic_0000001470319382_li175081928193619">Automatically diagnoses large SQL statements, slow SQL statements, and related submission information, displays the information in multiple dimensions for cluster administrators, and provides diagnosis and optimization suggestions for these statements.</li></ul>
</div>
<div class="section" id="mrs_01_24838__en-us_topic_0000001470319382_section132193223149"><h4 class="sectiontitle">Prerequisites</h4><ul id="mrs_01_24838__en-us_topic_0000001470319382_ul76071022173513"><li id="mrs_01_24838__en-us_topic_0000001470319382_li164405414610">The cluster is running properly and at least one QAS instance has been installed.</li><li id="mrs_01_24838__en-us_topic_0000001470319382_li12608132214357">You have created a user for accessing the <span id="mrs_01_24838__en-us_topic_0000001470319382_text6140253894">HetuEngine</span> web UI, for example, <strong id="mrs_01_24838__en-us_topic_0000001470319382_b1789512710489">Hetu_user</strong>. For details, see <a href="mrs_01_1714.html">Creating a HetuEngine User</a>.</li></ul>
</div>
<div class="section" id="mrs_01_24838__en-us_topic_0000001470319382_section19823203416423"><h4 class="sectiontitle">Enabling SQL Diagnosis</h4><p id="mrs_01_24838__en-us_topic_0000001470319382_p54442050203012">The SQL diagnosis function of <span id="mrs_01_24838__en-us_topic_0000001470319382_text3722022205515">HetuEngine</span> is enabled by default. You can perform the following steps to configure other common parameters or retain the default settings:</p>
<ol id="mrs_01_24838__en-us_topic_0000001470319382_ol265818563118"><li id="mrs_01_24838__en-us_topic_0000001470319382_li196581154313"><span>Log in to FusionInsight Manager as user <strong id="mrs_01_24838__en-us_topic_0000001470319382_b4415174594816">Hetu_user</strong>.</span></li><li id="mrs_01_24838__en-us_topic_0000001470319382_li1782201015310"><span>Choose <strong id="mrs_01_24838__en-us_topic_0000001470319382_b11236104112205">Cluster</strong> &gt; <strong id="mrs_01_24838__en-us_topic_0000001470319382_b139012442201">Services</strong> &gt; <strong id="mrs_01_24838__en-us_topic_0000001470319382_b576095512206"><span id="mrs_01_24838__en-us_topic_0000001470319382_text310193155514">HetuEngine</span></strong>. Click <strong id="mrs_01_24838__en-us_topic_0000001470319382_b1524129122113">Configurations</strong> then <strong id="mrs_01_24838__en-us_topic_0000001470319382_b14213193215">All Configurations</strong>, click <strong id="mrs_01_24838__en-us_topic_0000001470319382_b364044917216">QAS(Role)</strong>, and select <strong id="mrs_01_24838__en-us_topic_0000001470319382_b7956195110220">SQL Diagnosis</strong>. If <strong id="mrs_01_24838__en-us_topic_0000001470319382_b17434194162313">qas.sql.auto.diagnosis.enabled</strong> is set to <strong id="mrs_01_24838__en-us_topic_0000001470319382_b8229154192415">true</strong>, the SQL diagnosis function is enabled. In this case, you can configure recommended SQL diagnosis parameters based on service requirements.</span></li><li id="mrs_01_24838__en-us_topic_0000001470319382_li742681319317"><span>Click <span class="uicontrol" id="mrs_01_24838__en-us_topic_0000001470319382_uicontrol363261383916"><b>Save</b></span>.</span></li><li id="mrs_01_24838__en-us_topic_0000001470319382_li7863815103110"><span>Click <strong id="mrs_01_24838__en-us_topic_0000001470319382_b159601657054248">Instance</strong>, select all QAS instances, click <strong id="mrs_01_24838__en-us_topic_0000001470319382_b31163926854248">More</strong>, and select <strong id="mrs_01_24838__en-us_topic_0000001470319382_b204655715154248">Restart Instance</strong>. In the displayed dialog box, enter the password to restart all QAS instances for the parameters to take effect.</span></li></ol>
</div>
<div class="section" id="mrs_01_24838__en-us_topic_0000001470319382_section6452810203020"><h4 class="sectiontitle">Viewing SQL Diagnosis Results</h4><ol id="mrs_01_24838__en-us_topic_0000001470319382_ol494912285306"><li id="mrs_01_24838__en-us_topic_0000001470319382_li1394992819301"><span>Log in to FusionInsight Manager as user <strong id="mrs_01_24838__en-us_topic_0000001470319382_b6141525163011">Hetu_user</strong>.</span></li><li id="mrs_01_24838__en-us_topic_0000001470319382_li1494982812306"><span>Choose <strong id="mrs_01_24838__en-us_topic_0000001470319382_b178386271154248">Cluster</strong> &gt; <strong id="mrs_01_24838__en-us_topic_0000001470319382_b163982847054248">Services</strong> &gt; <strong id="mrs_01_24838__en-us_topic_0000001470319382_b135746227854248"><span id="mrs_01_24838__en-us_topic_0000001470319382_text192647103054248">HetuEngine</span></strong> to go its service page.</span></li><li id="mrs_01_24838__en-us_topic_0000001470319382_li20949182816307"><span>In the <strong id="mrs_01_24838__en-us_topic_0000001470319382_b69305923154248">Basic Information</strong> area on the <strong id="mrs_01_24838__en-us_topic_0000001470319382_b167650001554248">Dashboard</strong> page, click the link next to <strong id="mrs_01_24838__en-us_topic_0000001470319382_b35657077554248">HSConsole WebUI</strong>. The HSConsole page is displayed.</span></li><li id="mrs_01_24838__en-us_topic_0000001470319382_li1495072816301"><span>Choose <strong id="mrs_01_24838__en-us_topic_0000001470319382_b123789549854248">SQL O&amp;M</strong> to view SQL diagnosis results.</span><p><ul id="mrs_01_24838__en-us_topic_0000001470319382_ul1141525173010"><li id="mrs_01_24838__en-us_topic_0000001470319382_li1214132573012">On the <strong id="mrs_01_24838__en-us_topic_0000001470319382_b73117275854248">Overview</strong> page, you can view the overall running status of historical tasks, including the query duration distribution chart by segment, query user distribution chart, total submitted SQL queries, SQL execution success rate, average SQL query response time, number of queries, average execution time, and average waiting time.</li><li id="mrs_01_24838__en-us_topic_0000001470319382_li0141202543017">Choose <strong id="mrs_01_24838__en-us_topic_0000001470319382_b148513840254248">SQL Query Diagnostics</strong> &gt; <strong id="mrs_01_24838__en-us_topic_0000001470319382_b108660222654248">Slow Query Distribution</strong> to view the slow query distribution of historical tasks, including:<ul id="mrs_01_24838__en-us_topic_0000001470319382_ul4141142583017"><li id="mrs_01_24838__en-us_topic_0000001470319382_li314111252301">Slow SQL statistics: collects statistics on the number of slow queries (the query time is greater than the slow query threshold) submitted by each tenant.</li><li id="mrs_01_24838__en-us_topic_0000001470319382_li191416257308">Top users with the maximum slow query requests: collects statistics on slow query statistics of each user. The statistics can be sorted in a list and exported.</li></ul>
</li><li id="mrs_01_24838__en-us_topic_0000001470319382_li31411525113014">Choose <strong id="mrs_01_24838__en-us_topic_0000001470319382_b31507133954248">SQL Query Diagnostics</strong> &gt; <strong id="mrs_01_24838__en-us_topic_0000001470319382_b98500057754248">Slow Queries</strong> to view the slow query list, diagnosis results, and optimization suggestions of historical tasks. Query results can be exported.<div class="note" id="mrs_01_24838__en-us_topic_0000001470319382_note1141172518301"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_24838__en-us_topic_0000001470319382_p31412258304">The validity period of historical statistics depends on the JVM memory size of HSConsole instances and cannot exceed 60 days.</p>
</div></div>
</li></ul>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1710.html">Using HetuEngine</a></div>
</div>
</div>