Slow SQL queries significantly decrease the database stability. When issues such as high workloads and performance jitters occur on databases, database administrators (DBAs) or developers first check whether slow query logs are generated. Database Autonomy Service (DAS) provides the log analysis feature for slow queries. DAS collects statistics on and analyzes SQL statements whose execution duration exceeds the specified threshold value and provides solutions. You can troubleshoot database performance issues with ease. This enhances system reliability and stability.
Background information
Slow query logs are generated by the database kernel. Relevant parameters and thresholds vary based on the database engine. For more information, see the corresponding official documentation.
Procedure
Log on to the DAS console.
In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.
On the page that appears, find the database instance that you want to manage and click the instance ID. The instance details page appears.
In the left-side navigation pane, choose .
On the Slow Log Analysis tab, specify a time range and view the Slow Query Log Trends, Event Distribution, Slow Query Log Statistics, and Slow Query Log Details within the specified time range.
NoteWhen you specify the time range, the end time must be later than the start time, and the interval between the start time and the end time cannot exceed 24 hours. You can query slow query logs within the previous month.
In the Slow Query Log Trends section, you can click a point in time in the trend chart and view the statistics and details of the slow query logs at the point in time.
NoteIf the content of an SQL statement is not completely displayed due to length limits of the GUI, you can move the pointer over the SQL statement to view the complete content.
Select the desired node from the Node ID drop-down list to view the number of slow queries on the node.
In the Event Distribution section, perform the following operation:
You can query slow query log events within the specified time range. Click an event to view its details.
You can click
to download slow query logs to your computer. Click
to populate the selected and entered parameters to the OpenAPI console for API debugging.On the Slow Query Log Statistics tab, find the SQL template that you want to manage and click Details in the Actions column. In the Slow Log Sample dialog box, view the slow query log sample of the SQL template.
On the Slow Query Log Details tab, find the SQL statement that you want to manage and click Optimize or Throttling in the Actions column to perform SQL diagnostic optimization or SQL throttling.