Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 请教下dashboard上执行计划各时间的含义
【 TiDB Usage Environment】Production Environment
【 TiDB Version】v5.3
【Reproduction Path】What operations were performed when the issue occurred
【Encountered Issue: Issue Phenomenon and Impact】
Could the experts please explain what the following fields in the dashboard’s execution plan mean and how to understand them:
1: SQL Execution Time 3.4s
2: Coprocessor Execution Time 11.1s
2.1: Coprocessor Cumulative Wait Time 47.2s
2.2: Coprocessor Cumulative Execution Time 35.5s
【Resource Configuration】
【Attachments: Screenshots/Logs/Monitoring】
The SQL execution time is literal, meaning how long it took to execute the SQL. The Coprocessor refers to the time used by TiKV to execute the SQL. Since there are multiple TiKVs running in parallel, this is the total execution time for each TiKV combined.
Personal understanding:
1: SQL execution time 3.4s
The time for SQL in TiDB, from TiDB to TiKV, and then back from TiKV to TiDB.
2: Coprocessor execution time 11.1s
Assuming there are 2 Coprocessors, this value is the cumulative time of each Coprocessor (Coprocessor1 5.55 + Coprocessor2 5.55) = 11.1s. This should include both Coprocessor waiting time and execution time.
2.1: Cumulative Coprocessor waiting time 47.2s
During the execution of the Coprocessor, there are various situations that require waiting, such as scheduling, locks, consistency mutexes, etc. This is the cumulative time of individual waiting times.
2.2: Cumulative Coprocessor execution time 35.5s
Excluding the above waiting time, the actual time spent accessing TiKV (speculation).
Since a single SQL statement may have parallel execution operations internally, the cumulative time of each stage may exceed the actual execution time of the SQL statement.
The cumulative time is equivalent to the total time if executed serially, right?
Directly execute the corresponding SQL with EXPLAIN ANALYZE to get the execution plan and take a look.
In simple terms, the time taken to retrieve data from TiKV still depends on the execution plan.
The coprocessor refers to the time taken for computation pushed down to the storage layer. This pushdown is concurrent, with some being fast and some being slow.
The time of the coprocessor is the cumulative time of multiple TiKVs.
The main thing is to look at the SQL execution time.
Isn’t it clearly explained in the description?