Updated on 2024-05-21 GMT+08:00

Top SQL

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.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page, choose Databases > GaussDB(for MySQL).
  4. On the Instances page, click the DB instance name to go to the Basic Information page.
  5. In the navigation pane, choose DBA Assistant > Historical Diagnosis.
  6. Choose SQL Explorer > Top SQL.

    Top SQL needs to be purchased separately. To use this function, subscribe to Intelligent O&M first.

    Only the data of the last hour is displayed if Intelligent O&M is not subscribed. The data will be automatically deleted after one hour. If Intelligent O&M is subscribed, you can configure how long that top SQL statements are stored for (spanning no more than one day).

  7. Click Subscribe. In the displayed dialog box, you can learn about Intelligent O&M functions and pricing.

  8. After subscribing to Intelligent O&M, view top SQL statements of your instance.
  9. View execution durations of the top SQL statements in the last 1 hour, last 3 hours, last 6 hours, or a custom time period (spanning no more 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 Concurrency Control in the Operation column. For details, see Concurrency Control.