This topic describes the full request feature and how to enable the full request feature.

Overview

When you use a MySQL database, you may encounter the following issues:

  • For example, an alert for 100% CPU utilization was generated at 03:00 (UTC+08:00) but no slow SQL statements were collected during that period. In this case, it can be hard to locate the cause.
  • Hard to obtain stress testing templates. For example, if stress testing is to be carried out the following week, the database administrator must collect SQL templates and the execution frequency of each SQL statement from individual data providers. This method is inefficient and can cause errors and inconsistencies.
  • Hard to determine whether to optimize slow SQL statements: Not all the slow SQL statements need to be immediately optimized. You need to know the most resource-consuming SQL statements in the database, and optimize these SQL statements to improve the instance stability.
As a solution, you can use the full request feature to perform diagnostics on SQL statements:
  • Performance issue troubleshooting: You can check the health of SQL statements, the resource consumption of top resource-consuming SQL statements, the number of executions, and the execution duration.
  • SQL templates: You can use the SQL templates to perform various operations, such as business traffic analysis, stress testing for sales promotions, and capacity planning.
  • SQL sample data: You can check the traffic information about your instance, such as the sources from which the access requests were sent and the users who sent the access requests.

Procedure

  1. Log on to the DAS console.
  2. In the left-side navigation pane, choose Request Analysis > Full Request.
    Note
    • You can specify a time range to view the Full Request Trend chart and the Full Request Statistics table.
    • You can export the data of Full Request Statistic. You can export up to 10 million rows of data at a time.

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.

    Example:

    • The specified time range is 10:40:00 on October 19, 2020 to 10:40:00 on November 19, 2020.
    • 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%.
    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.
  • 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 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 corresponding SQL statements occupy a larger number of MySQL resources for execution. You can optimize these SQL statements to achieve high cost-effectiveness.
  • 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.