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.
View slow log trends and statistics
- Log on to the PolarDB console.
- On the top of the page, select the region where the target cluster is located.
- Find the target cluster and click the cluster ID to go to the Overview page.
- In the left-side navigation pane, choose .
- In the Slow Log Trend section, use one of the following methods to view slow log trends:
Note By default, the slow log trends within the last 15 minutes appear.
- 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.
- 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
- 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.