AnalyticDB for MySQL clusters provide the SQL diagnostics feature to search for SQL queries that meet a variety of conditions (such as slow queries) and show the search results as a chart. You can also download and save the search results to your computer. This topic describes how to go to the SQL Diagnostics tab and describes the supported search methods.

Go to the SQL Diagnostics tab

  1. Log on to the AnalyticDB for MySQL console by your Alibaba Cloud account.
  2. In the upper-left corner of the page, select the region where clusters reside.
  3. In the left-side navigation pane, click Clusters.
  4. On the V3.0 Clusters tab, click the target Cluster ID.
  5. In the left-side navigation pane, click Diagnostics and Optimization to go to the SQL Diagnostics tab.
    1
    No. Description
    The search conditions of SQL queries. You can select a variety of dimensions and time ranges to retrieve SQL query information that meets the conditions. For more information, see Search methods.
    The search results of SQL queries that are displayed as a chart. For more information, see Query monitoring charts.
    The search results of SQL queries that are displayed as a list. For more information, see Query lists.

Search methods

AnalyticDB for MySQL clusters allow you to use the following methods to search for the details of SQL queries:
  • General search
    • Search conditions: You can search for SQL queries based on a specific time range such as Last 5 Minutes, a state such as Completed Queries, or duration such as Long-running Queries (Longer Than 1 Minute).
    • Result display: The general search results are displayed in the Query Monitoring Information section and on the Queries tab. For more information about Query Monitoring Information and Queries, see Use query monitoring charts and lists.
    Note
    • By default, SQL queries that meet the Last 5 Minutes and Top 100 Most Time-consuming Queries conditions are displayed. Queries in progress are not included.
    • AnalyticDB for MySQL supports custom search of SQL queries within the last two weeks. The end time of the custom search must be later than the start time, and the interval between the start and end time cannot exceed 24 hours.
  • Advanced search
    • Search conditions: You can filter general search results based on a variety of conditions such as Peak Memory, Amount of Scanned Data, User, Database, and Resource Group. Valid values of User, Database, and Resource Group are existing values in the general search results instead of all values in the current AnalyticDB for MySQL cluster.

      For example, an AnalyticDB for MySQL cluster contains three databases: db1, db2, and db3. Only db1 and db2 are involved in the general search results. In this case, valid values of Database in the upper-right corner of the advanced search section are db1 and db2.

    • Result display: Advanced search results are displayed only on the Queries tab. Results in the Query Monitoring Information section are not affected.