All Products
Search
Document Center

ApsaraDB RDS:View details about the slow query logs

Last Updated:Mar 28, 2026

The slow query log feature is enabled by default for ApsaraDB RDS for MySQL. This page explains how to view slow query log details in the console, and covers the collection rules that affect what appears in the logs — including SQL truncation, log loss under high concurrency, and timestamp semantics that vary by engine version.

Collection rules and limits

Understanding these rules helps you interpret log data correctly and troubleshoot missing or unexpected entries.

SQL statement truncation

Slow query logs record SQL statements up to 8,192 bytes. Statements that exceed this limit are truncated. SQL Explorer logs are subject to the same limit. The 8,192-byte limit cannot be adjusted. To identify the complete SQL content, retrieve the full request from your application.

Log loss under high concurrency

If more than 600 slow query log entries are generated within one minute, some entries may be dropped. To reduce this risk, upgrade the minor engine version to 20191212 or later.

Timestamp semantics by engine version

The meaning of the collection timestamp changed across engine versions:

  • Before versions 20211231 (MySQL 5.7.35) and 20220530 (MySQL 8.0.25): The timestamp records the SQL execution end time.

  • Since versions 20211231 (MySQL 5.7.35) and 20220530 (MySQL 8.0.25): The timestamp records the SQL execution start time.

If log entries appear out of order, or if timestamps differ from what your application records, check which engine version your instance is running.

View slow query log details

  1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region where the instance resides. Click the instance ID.

  2. In the left-side navigation pane, choose Logs > Slow Log Analysis.

  3. On the Slow Log Analysis tab, select the time range. The page displays slow query statistics and log details. Each log entry includes the following fields:

    FieldDescription
    SQL statementThe SQL text recorded for the slow query, truncated at 8,192 bytes if the statement exceeds this limit
    Access sourceThe client host or IP address from which the query originated
    DatabaseThe database on which the query was executed
    Execution timeThe duration of the query in seconds

    Slow Log Analysis tab showing query statistics and log entries

You can also view slow query log details on the Slow Log Details tab of the Logs page.
Important

To export slow query log details, use Slow Log Analysis.

What's next