Database Autonomy Service (DAS) provides SQL Explorer. You can use SQL Explorer to diagnose the health status of SQL statements and troubleshoot performance issues. This topic describes how to use SQL Explorer in the SQL Explorer and Audit module.

Prerequisites

  • The database instance that you want to manage is connected to DAS and is in the Accessed state.
  • DAS Professional Edition is activated for the database instance. For more information, see DAS Professional Edition.
  • The full request analysis feature is enabled for the database instance. For more information about the full request analysis feature, see Full request analysis.
  • DAS provides SQL Explorer only for the following types of database instances:
    • ApsaraDB RDS for MySQL High-availability Edition and Enterprise Edition
    • ApsaraDB RDS for PostgreSQL High-availability Edition
    • ApsaraDB PolarDB MySQL-compatible edition Single Node Edition, Archive Database Edition, and Cluster Edition
    • ApsaraDB PolarDB PostgreSQL-compatible edition Cluster Edition

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 ID of the instance that you want to manage.
  3. In the left-side navigation pane of the page that appears, click SQL Explorer and Audit. On the page that appears, click the SQL Explorer tab.
    0
  4. In the Full Request Analysis - Professional Edition section, you can view the trend charts. In the Full Request Statistics section, you can view and export the full request statistics.
    Note You can export up to 10 million rows of data at a time. For more information, see Full request analysis.

Description

  • Execution Duration Distribution: On the Execution Duration Distribution tab, you can specify a time range to view the distribution of different SQL execution durations. The statistics are collected every minute. SQL 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 duration falls 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 duration falls 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 duration falls 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 duration falls 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 duration falls 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 duration falls 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 duration falls within this range.
    Note In the Execution Duration Distribution chart, the more the areas are closer to blue, the healthier the instance is when it runs SQL queries. The more the areas are closer to orange and red, the less healthy the instance is when it runs SQL queries.
  • Execution Duration: On the Execution Duration tab, you can specify a time range to view the execution durations of SQL queries.
  • Full Request Statistics: In the Full Request Statistics section, you can specify a time range to view details about SQL statements, such as the SQL template, percentage of the execution duration, average execution duration, and execution trend.
    Note You can calculate the execution duration percentage for the SQL statements that use a specific SQL template based on the following formula: Execution duration percentage = (Execution duration of the SQL statements that use the SQL template × Number of executions of the SQL statements)/(Total execution duration of all SQL statements × Total number of executions) × 100%. Higher execution duration percentages indicate that the instance uses a larger number of MySQL resources to execute the corresponding SQL statements.
  • SQL ID: You can click an SQL ID to view the performance trend and sample data of the SQL statements that use the corresponding SQL template.
  • SQL Sample: On the SQL Sample tab, you can view the client that initiated each sample SQL request.