The query details page displays the query-level, stage-level, and task-level statistics generated during execution by using numbers and tables. These statistics include the time consumed, CPU time, memory, and number of data rows and amount of data scanned or received from networks.

Note

Query-level statistics

Basic information
The following figure shows the basic information of a query that can be viewed. The information includes the final status, user that executes the query, client IP address, database used for connections, total number of stages, and total number of tasks.
Time information
The following figure shows the time information of a query that can be viewed. The information includes the query submission time, duration from submitting the query to returning a response, time spent in queuing before the query begins to be executed, and time spent in generating an execution plan.
Resource information
The following figure shows the resource usage information of a query that can be viewed. The information includes CPU time and peak memory.

SQL statements

2021030301

Stage-level statistics

2021030302
State
The final state of a stage, which can be FINISHED, CANCELED, or FAILED.
Operator Cost
The total CPU time consumed by all operators of all tasks in a stage. You can compare the operator costs between different stages to determine which stages involve computing of a large amount of data.
Peak Memory
The peak memory used by a stage during execution. You can compare the peak memory between different stages to determine which stages consume a large amount of memory resources.
CPU Time
The maximum, minimum, and average values of CPU time consumed by all operators of all tasks in a stage. You can use these values to determine whether the stage has long tails. Long tails may occur when tasks process different amounts of data and pressure increases on compute nodes.
Input Size
The maximum, minimum, and average values of input data amounts of all tasks in a stage. You can use these values to initially determine whether the data to be processed by the stage is skewed. If the data is skewed, long tails occur in the CPU time. Data skew may occur if you select inappropriate distribution keys for tables or distribution keys are skewed when you redistribute data.
Scan Size
If Tablescan operators exist in a stage, this field indicates the maximum, minimum, and average values of scanned data amounts of each task in the stage. If the three values are significantly different from one another, you may have selected inappropriate distribution keys for tables in data sources. A stage may have multiple Tablescan operators that can read data from different tables.
Scan Time
If Tablescan operators exist in the stage, this field indicates the maximum, minimum, and average values of time consumed by each task in the stage to read data from a data source. If the three values are significantly different from one another, data skew may have occurred due to inappropriate distribution keys or uneven pressure on executor nodes.

Task-level statistics

You can click a position in a row of each table to view the detailed metrics of all tasks in a stage. The following table describes the metrics.20210303032021030304
State
The final execution status of a task, which can be FINISHED, CANCELED, or FAILED.
ElapsedTime
Data shards are processed in parallel by multiple threads in AnalyticDB for MySQL tasks. ElapsedTime indicates the amount of time elapsed from when the task begins to when the last thread completes processing data shards. The following figure shows that four threads process data in a task. The elapsed time is the result of T2 minus T1.2021030306
Peak Memory
The peak memory used by a task to process data.
Operator Cost
The total CPU time consumed by a task to process data. You can use the following formula to calculate the operator cost of the task in the preceding figure:
OperatorCost = 100ms + 110ms + 70ms + 90ms
Input Rows/ Input Size
The total number of input rows and the total amount of input data in each task.
Output Rows/Output Size
The total number of output rows and the total amount of output data in each task.
Scan Rows/Scan Size/ScanCost
If a task contains operators that read data from a source table, Scan Rows indicates the number of rows of scanned data, Scan Size indicates the amount of scanned data, and Scan Cost indicates the total time consumed to scan data.