You can use the real-time diagnostics feature to quickly view the abnormal SQL number trend and its details.
Prerequisites
You have completed one-click diagnostics and generated a diagnostic report. If not, please refer to Initiate one-click diagnostics.
Procedure
In the Diagnostic Report section, click Real-Time Diagnostics.
In the Real-Time Diagnostics section, view the Number of Suspicious SQL, Number of Slow SQL, Number of Real-Time Sessions, and Number of Real-Time Active Sessions. Click View More to jump to the SQL tab of the real-time diagnostics feature.
In the Real-Time Diagnostics section, view the Abnormal SQL Number Trend.
On the Slow SQL tab, view the following default metrics: SQL Text, Tenant Name, SQL ID, Database, Total Executions, Total Database Time Consumption (ms), Average Time Consumption (ms), Maximum Response Time (ms), CPU Time (ms), Plan Generation Time (ms), Maximum Number of Returned Rows, Rows of Memory Reads, Rows of Physical Reads, and Actions.
Click the link in the SQL Text column to view the SQL text, SQL sampling details, etc.
Filter the SQL text by Tenant Name and Database.
Sort the SQL text by Total Executions, Total Database Time Consumption (ms), Average Time Consumption (ms), Maximum Response Time (ms), CPU Time (ms), Plan Generation Time (ms), Maximum Number of Returned Rows, Rows of Memory Reads, and Rows of Physical Reads.
In the Actions column, click View Sample to view the SQL sample.
Click the icon
to query more metrics in the Manage Columns window that pops up.If you enable Aggregate In Query, the results of IN queries will be aggregated without affecting statistics. You can move your pointer over the SQL ID of an SQL statement identified by Aggregated to view the SQL IDs of other aggregated SQL statements.
Note
For SQL statements that contain IN clauses and whose contents consist of different numbers of simple constants, if Aggregate In Query is not enabled, the real-time diagnostics feature treats them as different types of SQL statements; if Aggregate In Query is enabled, the real-time diagnostics feature treats them as the same type of SQL statements and aggregates the statistics of these SQL statements into the same row.
On the Suspicious SQL tab, view the following default metrics: SQL Text, Tenant Name, SQL ID, Database, Total Executions, Total Database Time Consumption (ms), Average Time Consumption (ms), CPU Time (ms), Logical Reads, Plan Generation Time (ms), Total Retries, and Average Retries.
Click the link in the SQL Text column to view the SQL text, SQL diagnostic details, etc.
Filter the SQL text by Tenant Name and Database.
Sort the SQL text by Total Executions, Total Database Time Consumption (ms), Average Time Consumption (ms), CPU Time (ms), Logical Reads, and Plan Generation Time (ms).
Click the icon
to query more metrics in the Manage Columns window that pops up.If you enable Aggregate In Query, the results of IN queries will be aggregated without affecting statistics. You can move your pointer over the SQL ID of an SQL statement identified by Aggregated to view the SQL IDs of other aggregated SQL statements.
Note
For SQL statements that contain IN clauses and whose contents consist of different numbers of simple constants, if Aggregate In Query is not enabled, the real-time diagnostics feature treats them as different types of SQL statements; if Aggregate In Query is enabled, the real-time diagnostics feature treats them as the same type of SQL statements and aggregates the statistics of these SQL statements into the same row.