Slow query logs
Database Autonomy Service (DAS) collects and analyzes SQL statements whose execution duration exceeds a specified threshold, helping you quickly identify and resolve slow query issues that affect database stability and performance.
Background
Slow query logs are generated by the database kernel. Configuration parameters and thresholds vary by database engine. For 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.
Click the Compute Node (CN) or Data Node (DN) tab to view slow query logs for the respective nodes.
In the Slow Log Trend chart, you can select a point in time to view the Slow Log Statistics and Slow Log Details for that time.
NoteIf a slow SQL statement is too long to be fully displayed, you can hover the mouse pointer over the statement to view the complete SQL statement in a pop-up box.
In the Node ID drop-down list, view the number of slow requests for each node.
On the Slow Query Log Statistics and Slow Query Log Details tabs, you can click
to save the slow query log information to your computer.You can click
to go to the OpenAPI Explorer console. The currently selected and entered parameters are automatically carried over for API debugging.In the Event Distribution area, you can query for slow log events within a specified time range. Click an event to view its details.
In the Slow Log Statistics section, find the target SQL template and click Details in the Actions column to view a Slow Log Sample .
In the Actions column of the target SQL template, click Optimize. In the SQL Diagnostic Optimization dialog box that appears, view the SQL diagnosis results.
If you accept the diagnostic suggestion, click Copy in the upper-right corner of the page and paste the optimized SQL statement into your database client or DMS to execute it. If you do not accept the suggestion, click Cancel to end the diagnosis.
NoteDAS performs SQL diagnosis based on the complexity of the SQL statement, the data volume of the corresponding table, and the database payload. The diagnostic suggestion may take more than 20 seconds to be returned. After the diagnosis is complete, the diagnostics engine provides a diagnosis result, an optimization suggestion, and the expected optimization benefits. You can decide whether to accept the suggestion based on the diagnosis result.
In the Actions column of the target SQL template, click Throttling. On the SQL Throttling page, configure the throttling parameters to apply rate limiting to the target SQL statement. For more information, see SQL throttling.
Click Logical SQL Statements in the Actions column for the target SQL statement to view the corresponding SQL executed on the Compute Node (CN) or Data Node (DN).