Slow SQL queries

更新时间:
复制 MD 格式

PolarDB for MySQL on ENS clusters support slow SQL query analysis to help you analyze database performance issues. By default, an SQL statement is considered a slow SQL query if its execution duration exceeds 1 second, and the records are retained for 14 days.

Note

By default, a PolarDB for MySQL statement is considered a slow SQL query if its execution duration exceeds 1 second.

View slow SQL queries

  1. Log in to the PolarDB on ENS console.

  2. Find the target cluster and click its cluster ID.

  3. In the left-side navigation pane, choose Slow SQL queries.

At the top of the Slow SQL queries page, set a time range and click Query to filter the records. The table below displays the slow SQL queries with columns such as Execution start time, SQL statement, User, Client IP, Execution duration (s), and Rows scanned. To view more information about a query, click Details in the Actions column. Click Export Current List Data to export the records.

Usage notes

  • If an SQL statement exceeds the display length limit, the system truncates it. You can view the complete, formatted SQL statement in the details panel.

    Clicking Details in the Actions column for a slow SQL query opens the details panel. The Basic information section displays fields such as instance ID, client IP, database name, user, rows sent, rows scanned, execution start time, and execution duration. The SQL statement section displays the complete SQL statement in a code block.