PolarDB for MySQL provides the slow SQL analysis feature. This feature allows you to view slow log
trends and statistics. You can also obtain the diagnosis results and optimization
suggestions of SQL queries.
Prerequisites
The product edition must be Cluster Edition or Single Node.Archive Database does not support this feature. For more information about the three editions, see
Product editions.
View slow log trends and statistics
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster resides.
- Find the cluster, and then click the cluster ID.
- In the left-side navigation pane, choose .
- In the Slow Log Trend section, use one of the following methods to view slow log trends:
- Click Last 15 Minutes, 30 Minutes, or 1 Hour to view the slow log trends in the last 15 minutes, the last 30 minutes, or the last
hour.
- Specify the start time and the end time of the query, and click Search to view the slow log trends within a maximum of seven days.
Note By default, the slow log trends within the last 15 minutes appear.

- Optional:To view the slow log trends of a specific node, click the ID of the node in the Nodes section.
- In the Slow Log Trend section, click a time point in the line chart. On the Slow Log Statistics tab, you can view the slow log statistics that are generated within the 1-minute
period. The start time of the 1-minute period is the time point you click in the line
chart.
- To troubleshoot slow SQL queries, use one of the following methods:
- In the Actions column of the slow SQL query, click Sample to view the details of the slow SQL query.

- In the Actions column of the slow SQL query, click Optimize to view the diagnosis results and optimization suggestions of the slow SQL query.

Note You can also click Database Expert Service to purchase Database Expert Service. Database Expert Service provides professional
database services that are not provided by PolarDB, such as emergency solutions, health
diagnostics, performance optimization, security assurance, and data migration.
Export slow logs
You can click
Export Slow Log to export slow logs, and save the slow logs on the on-premises machines.
