This topic provides an overview of the Slow Log function in RDS for MySQL. With this function, you can view the trends and statistics of slow SQL statements.

CloudDBA in RDS for MySQL helps you to manage slow SQL statements throughout the entire lifecycle from dimensions including detection, analysis, diagnosis, optimization, and tracking.

Prerequisites

The MySQL version and RDS edition are as follows:

  • MySQL 8.0 High-availability Edition
  • MySQL 5.7 High-availability Edition/Enterprise Edition
  • MySQL 5.6
  • MySQL 5.5

Handle slow SQL statements

  1. Log on to the RDS console.
  2. Select the target region.Select a region
  3. Find the target RDS instance and click the instance ID.
  4. In the left-side navigation pane, choose CloudDBA > Slow Log.
  5. Use one of the following two methods to view Slow Log Trend:
    • Click Last 24 Hours to view slow SQL statements within the last 24 hours.
    • Set the query start date and end date, and then click Search to view slow SQL statements within up to seven days.
    Note By default, the system displays slow SQL statements of the Last 24 Hours.
    Slow Log Trend section
  6. View the Slow Log Trend line chart. If you click a time point at which slow SQL statements were detected, then you can view statistics of slow SQL statements in the lower Slow Log Statistics section.Slow Log Statistics section
  7. Use one of the following two methods to locate problems that cause slow SQL statements:
    • Find the target slow SQL statement and in the Actions column click the sample button to view details about the slow SQL statement.
    • Find the target slow SQL statement and in the Actions column click the optimize button to view diagnostics and optimization information about the slow SQL statement.
      Note You can purchase a database expert service. This service provides functions, such as emergency handling, health diagnosis, performance optimization, escort, and Oracle migration, that are beyond the service scope of the cloud database.

Export slow SQL statements

Click Export Slow Log to save statics of slow SQL statements to your computer.Export Slow Log