Slow SQL queries can severely impact database stability. When encountering high workloads or performance fluctuations, database administrators and developers typically start by checking for slow-running queries. Database Autonomy Service (DAS) provides a slow query log analysis feature that collects and analyzes SQL statements exceeding a specified execution time threshold. This helps you quickly identify and resolve database performance issues, improving system stability and reliability.
Background
The slow query log is generated by the database kernel. Configuration parameters and thresholds vary depending on the database engine. For specific details, refer to the official documentation for your database engine.
Procedure
Log on to the DAS console.
In the navigation pane on the left, click .
Find the target instance and click the instance ID to open the instance details page.
-
In the left-side navigation pane, click .
-
Select a time range to view the Slow Log Trend, Event Distribution, Slow Log Statistics, and Slow Log Details.
-
In the Slow Log Trend chart, you can select a specific point in time to view the corresponding Slow Log Statistics and Slow Log Details.
NoteIf a slow SQL statement is too long to be fully displayed, hover the pointer over the statement to view the complete text in a pop-up window.
-
Click the Node ID drop-down list to view the number of slow requests for each node.
-
In the Event Distribution section, you can find slow log events within the specified time range. Click an event to view its details.
-
On the Slow Query Log Statistics and Slow Query Log Details tabs, click
to save the slow query log information to a local file. -
Click
to go to OpenAPI Explorer and debug the API. The currently selected and entered parameters are passed automatically. -
In the Slow Log Statistics section, find the target SQL template and click Details in the Actions column to view its slow query log details.
-
In the Slow Log Details section, you can also click Optimize or Throttling in the Actions column for a target SQL statement to perform SQL Diagnostic Optimization or SQL Throttling.
-