This topic describes how to enable, use, and disable the full SQL query analysis feature of DAS (formerly known as HDM).

Prerequisites

  • Make sure that you have logged on to the DAS console.
  • A database instance is connected to DAS. For more information about how to connect a database instance to DAS, see Access other self-managed database instances.
  • The full SQL query analysis feature is available only for self-managed MySQL databases.

Procedure

Enable the full SQL query analysis feature

By default, Full Request Analysis is disabled. To enable this feature, perform the following steps:
  • In the left-side navigation pane, click Instance Monitoring. On the Instance Monitoring page, find the database instance for which you want to enable the full SQL query analysis feature and choose Performance > Full Request in the Actions column. Make sure that the connection status of the instance is Accessed.
  • On the page that appears, click View Enable Mode. If you have purchased DAS Professional Edition, click Enable Professional Edition in the dialog box that appears. If you have not purchased DAS Professional Edition, click Buy in the dialog box that appears.
Note After about 10 minutes, you can view the trends and statistics of full SQL queries.

Key metrics

Execution duration distribution

Note In the Execution Duration Distribution tab, the colder colored areas in the chart indicate the proportion of executed SQL queries whose health status is good. The warmer colored areas indicate the proportion of executed SQL queries whose health status is bad.

From the chart in the Execution Duration Distribution tab, you can view the execution durations of SQL queries based on the time range that you specify. The statistical data is collected every minute for the following durations:

  • [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 is greater than 0.1s and less than or equal 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.

Example:

  • Assume that a time range from 2020-10-19 10:40:00 to 2020-11-19 10:40:00 is specified.
  • The percentage of SQL queries whose execution durations fall within the [0,1] ms range is 34.30%.
  • The percentage of SQL queries whose execution durations fall within the (10,100] ms range is 23.13%.
  • The percentage of SQL queries whose execution durations fall within the (0.1,1]s range is 25.98%.

Execution duration (SQL response time)

You can view the execution durations of SQL queries based on the time range that you specify.

Full Request Statistics

In the Full Request Statistics tab, 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.

You can calculate the execution duration percentage for each SQL statement based on the following formula: 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 execution of SQL statements occupies a larger number of MySQL resources. You can optimize these SQL statements to achieve high cost-effectiveness.

Note You can click the ID of an SQL statement to view the performance trend and sample data of the SQL statement.

SQL sample

On the SQL Sample tab, you can view the client IP address from which each SQL request is sent.