Slow SQL queries significantly decrease the stability of databases. When an issue such as high workloads and performance jitter occurs on a database, database administrators or developers first checks whether slow query log records are being collected. Database Autonomy Service (DAS) provides request analysis features to help you diagnose SQL statements.

Prerequisites

DAS provides the request analysis features only for the following types of database instances:
  • ApsaraDB RDS for MySQL
  • ApsaraDB for Redis
  • ApsaraDB for MongoDB

Slow query log analysis

  1. In the left-side navigation pane, choose Request Analysis > Slow Query Logs.
  2. On the Global Slow Log Trend page, you can use one of the following methods to view the slow query log trends of your database instances:
    • Click Last 24 Hours, Last 3 Days, or Last 7 Days to view the slow query log trend for a specified type of database instances within the last 24 hours, last three days, or last seven days.
    • Specify a start time and an end time and click Search to view the slow query log trend for a specified type of database instances within the specified time range. The time range cannot exceed 24 hours. Only the slow query log statistics generated within the last 30 days can be queried.
      Note By default, the trend chart shows the changes in the number of slow query logs within the last 24 hours.
  3. In the line chart that shows the slow query log trend, click a point that represents a specific point in time when slow SQL queries occur. In the Top Instance Statistics section, you can view the slow query log statistics of the top 10 database instances on which most slow queries occurred.

Full request analysis

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 click Export to export the data in the Full Request Statistics table. You can export up to 10 million rows of data at a time.

References