Updated on 2025-10-28 GMT+08:00

Slow Query Logs

Slow SQL Analysis displays a chart of slow SQL statements and allows you to sort them by multiple dimensions, such as by user, client IP address, or SQL template. It helps you quickly identify bottlenecks and improve instance performance.

Procedure

  1. Log in to the Huawei Cloud console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner, and under Databases, click Data Admin Service.
  4. In the navigation pane, choose Intelligent O&M > Instance List.

    Alternatively, on the Overview page, click Go to Intelligent O&M.

  5. In the upper right corner of the Instance List page, search for instances by engine type, instance name, or instance IP.
  6. Locate the target instance and click Details.
  7. Choose SQL > Slow Query Logs.

    You can click to enable Collect Slow Query Logs.

    You can also click Log Settings in the upper right corner to enable Collect Slow Query Logs.

  8. On the Slow Query Logs tab page, perform the following operations:

    • Slow queries over time

      Select a time range (last hour, last 3 hours, last 12 hours, or a custom time range within three days).

      In the chart, you can hover your mouse at any point in time to view slow query logs or CPU usage.

    • Slow query log details

      View slow query log details in the lower part of the Slow Query Logs area. Slow query log details include the execution completion time, SQL statements, databases, clients, users, application names, execution durations, affected rows, CPU time, I/O logical reads, I/O physical reads, and I/O writes in the current period.

      Slow query log details of free instances cannot be exported. To use this function, set free instances as paid or upgrade Intelligent O&M.

    • Template statistics

      In the template statistics list, click View Sample in the Operation column to view the sample of a SQL statement template.

      Slow query log details of free instances cannot be exported. To use this function, set free instances as paid or upgrade Intelligent O&M.