You can use the SQL Explorer feature to check the health status of SQL statements and troubleshoot performance issues. This topic describes how to use the SQL Explorer feature in the SQL insight and audit module.

Prerequisites

  • A database instance is connected to Database Autonomy Service (DAS) and is in the Accessed state.
  • DAS Professional Edition is activated for the instance. For more information, see DAS Professional Edition.
  • The full request feature is enabled for the instance. For more information about the procedure, see Full request.
  • Only ApsaraDB RDS for MySQL High-availability Edition and PolarDB for MySQL Cluster Edition are supported.

Procedure

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Instance Monitoring. On the Instance Monitoring page, click the name of the instance that you want to manage. The instance details page appears.
  3. In the left-side navigation pane of the page that appears, click SQL insight and audit. Then, click the SQL Explorer tab.
    0
  4. In the Full Request Analysis section, view the trend charts. In the Full Request Statistics section, view the table. To export the data of Full Request Statistics, click Export.
    Note You can export up to 10 million rows of data at a time. For more information, see Full request.

Description

  • Execution Duration Distribution: On the Execution Duration Distribution tab, you can view the distribution of execution durations of SQL queries based on the time range that you specify. The statistical data is collected every minute. The execution durations are divided into seven ranges:
    • [0,1] ms: indicates that the execution duration ranges from 0 ms to 1 ms. From the chart, you can view the percentage of SQL queries whose execution durations fall within this range.
    • (1,2] ms: indicates that the execution duration is greater than 1 ms and less than or equal to 2 ms. From the chart, you can view the percentage of SQL queries whose execution durations fall within this range.
    • (2,3] ms: indicates that the execution duration is greater than 2 ms and less than or equal to 3 ms. From the chart, you can view the percentage of SQL queries whose execution durations fall within this range.
    • (3,10] ms: indicates that the execution duration is greater than 3 ms and less than or equal to 10 ms. From the chart, you can view the percentage of SQL queries whose execution durations fall within this range.
    • (10,100] ms: indicates that the execution duration is greater than 10 ms and less than or equal to 100 ms. From the chart, you can view the percentage of SQL queries whose execution durations fall within this range.
    • (0.1,1]s: indicates that the execution duration ranges from 0.1s (excluded) to 1s. From the chart, you can view the percentage of SQL queries whose execution durations fall within this range.
    • > 1s: indicates that the execution duration is greater than 1s. From the chart, you can view the percentage of SQL queries whose execution durations fall within this range.
    Note On the Execution Duration Distribution tab, the colder colored areas (blue) in the chart indicate the proportion of executed SQL queries whose health status is good. In addition, the warmer colored areas (orange and red) indicate the proportion of executed SQL queries whose health status is bad.
  • Execution Duration (SQL response time): On the Execution Duration tab, you can view the execution durations of SQL queries based on the specified time range in an easy manner.
  • Full Request Statistics: In the Full Request Statistics section, you can view the SQL statement details based on the time range that you specify. The details include the SQL text, duration percentage, average execution duration, and execution trend for each SQL statement.
    Note Execution duration percentage = (Execution duration of an SQL statement × Number of executions of the SQL statement)/(Total execution duration of all the SQL statements × Total number of executions) × 100%. Higher execution duration percentages indicate that the corresponding SQL statements occupy a larger number of MySQL resources for execution.
  • SQL ID: You can click an SQL ID to view the performance trend and the sample data of the SQL statement.
  • SQL Sample: On the SQL Sample tab, you can view the client that initiates the SQL request.