Slow query log

更新时间:
复制 MD 格式

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

  1. Log on to the DAS console.

  2. In the navigation pane on the left, click Intelligent O&M Center > Instance Monitoring .

  3. Find the target instance and click the instance ID to open the instance details page.

  4. In the left-side navigation pane, click Request Analysis > Slow Logs.

  5. 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.

      Note

      If 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 image to save the slow query log information to a local file.

    • Click image 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.

FAQ