AnalyticDB for MySQL provides the SQL diagnostics feature to display SQL queries that meet a variety of search conditions (such as slow queries) 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.
Usage notes
The SQL diagnostics feature is not supported for clusters that are created in the Germany (Frankfurt), UK (London), US (Silicon Valley), and US (Virginia) regions.
Go to the SQL Diagnostics tab
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. On the Clusters page, click an edition tab. Find the cluster that you want to manage and click the cluster ID.
In the left-side navigation pane, click Diagnostics and Optimization to go to the SQL Diagnostics and Optimization tab.
The following information is displayed on the SQL Diagnostics and Optimization tab:
The search results of SQL queries that are displayed in a chart. For more information, see Query monitoring charts.
The search results of SQL queries that are displayed in a list. For more information, see SQL queries.
Search methods
AnalyticDB for MySQL allows you to search for details of SQL queries by using the following methods:
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 a 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 SQL Queries tab. For more information about Query Monitoring Information and SQL Queries, see Use query monitoring charts and SQL queries.
NoteBy 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, assume that an AnalyticDB for MySQL cluster contains three databases:
db1
,db2
, anddb3
. Onlydb1
anddb2
are involved in the general search results. In this case, valid values of Database in the upper-right corner of the advanced search section aredb1
anddb2
.Result display: Advanced search results are displayed only on the SQL Queries tab. Results in the Query Monitoring Information section are not affected.