• Relational Database Service

  1. Help Center
  2. Relational Database Service
  3. User Guide
  4. Working with RDS for MySQL
  5. Viewing Logs
  6. Viewing Slow Query Logs

Viewing Slow Query Logs


Slow query logs record statements that exceed long_query_time (10 seconds by default). You can use these logs to identify and optimize the statements that are executing slowly.


  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click Service List. Under Database, click Relational Database Service to go to the RDS console.
  4. On the Instance Management page, click the DB instance for which you want to view logs.
  5. On the Slow Query Logs page, view log details.

    • You can categorize the logs by the following statement types:
      • All statement types
      • SELECT
      • INSERT
      • UPDATE
      • DELETE
      • CREATE
    • If description of a slow query log is truncated, locate the log and move your pointer over the description in the Execute Statement column to view details.

    If you execute identical SQL statements that have different parameters, only one of the statements will be displayed as an example. For example, if two select sleep(N) statements, select sleep(11) and select sleep(12), are executed in sequence, only select sleep(11) will be displayed.