Updated on 2025-08-21 GMT+08:00

Viewing Top SQL Statements

Scenarios

After Collect All SQL Statements is enabled, you can gain a comprehensive insight into SQL statements on the SQL Explorer page. Top SQL helps you locate exceptions.

Constraints

If Intelligent O&M is not subscribed to, you can only view data in the last hour by default. The data will be automatically deleted when it expires. If Intelligent O&M is subscribed, you can configure how long that top SQL statements are stored for (at most one day).

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > TaurusDB.
  4. On the Instances page, click the instance name.
  5. In the navigation pane, choose DBA Assistant > Historical Diagnosis.
  6. Choose SQL Explorer > Top SQL.
  7. Click Subscribe. In the displayed dialog box, you can learn about Intelligent O&M functions and pricing.

    Figure 1 Subscribing to Intelligent O&M

  8. View the top SQL statements of the DB instance.

    • View execution durations of the top SQL statements in the last 1 hour, last 3 hours, last 12 hours, or a custom time period (no longer than one day).
    • Click a point in time or drag to select a time period to view the SQL statistics of a SQL template.
    • Click to export information about all top SQL templates in the list. To use this export function, subscribe to Intelligent O&M.
    • Locate a SQL template and click Details to view the total execution times, average rows scanned, average execution duration, and the like.
    • Locate a SQL template and click SQL Throttling in the Operation column to add a SQL throttling rule. For details, see Configuring SQL Throttling.
    • Select Comparison by Date and select dates and a time range to view the top SQL statements in the time range on different days.