SQL diagnostics

更新时间:
复制 MD 格式

AnalyticDB for MySQL provides the sql diagnostics feature, which allows you to retrieve sql queries that match various criteria, such as slow queries. Results are displayed graphically and can be downloaded for offline analysis. This topic explains how to access the sql diagnostics page and use the supported search methods.

Access SQL diagnostics

  1. Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. Find the cluster that you want to manage and click the cluster ID.

  2. In the left-side navigation pane, click Diagnostics and Optimization to open the SQL Diagnostics and Optimization tab.

    The SQL Diagnostics and Optimization page displays the following information:

    • Search results for sql queries are displayed in a chart. For more information, see query monitoring chart.

    • Search results for sql queries are also displayed in a list. For more information, see SQL Queries.

Search methods

AnalyticDB for MySQL clusters support two methods for retrieving sql query details: general search and advanced search.

  • General search

    • Search criteria: Allows you to retrieve details of sql queries within a specific time range (such as Last 5 Minutes), by query status (for example, Completed Queries), or by execution time (for example, Long-running Queries (Longer Than 1 Minute)).

    • Result display: General search results appear in the Query Monitoring Information and the SQL Queries list. For more details about the Query Monitoring Information and SQL Queries list, see Introduction to the query monitoring chart and SQL Queries.

    Note
    • By default, the page displays the Top 100 Most Time-consuming Queries from the Last 5 Minutes. In-progress queries are excluded.

    • AnalyticDB for MySQL allows you to retrieve details of sql queries from the last two weeks by using a custom time range. The end time must be later than the start time, and the time range cannot exceed 24 hours.

  • Advanced search

    • Search criteria: The advanced search feature allows you to filter the results of a general search by criteria such as peak memory, data scanned, username, Database, and resource group. The options for the username, Database, and resource group filters are populated from the general search results, not from all values in the AnalyticDB for MySQL cluster.

      For example, if an AnalyticDB for MySQL cluster has three databases, db1, db2, and db3, but the general search results include only queries that involve db1 and db2, the Database filter in the advanced search section will offer only db1 and db2 as options.

    • Result display: Advanced search results appear only in the SQL Queries list and do not update the Query Monitoring Information.