-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Enhancement
The following query sets max_execution_time to 2s, but it actually takes 18.8s. It's checked that the build_task_duration takes most of the time, due to too many region reloading. This issue aims to add "max_execution_time check point" in build task process.
mysql> explain analyze SELECT
/*+ MAX_EXECUTION_TIME(2000) */
*
FROM
Name0
FORCE INDEX (PRIMARY)
WHERE
Name0.o_id >= ?
AND Name0.m_id = ?
AND ((Name0.o_id > ?))
ORDER BY
Name0.o_id
LIMIT
50;
| id | estRows | estCost | actRows | task | access object | execution info | operator info | memory | disk |
| Limit_11 | 50.00 | 1416150.54 | 50 | root | | time:980.5µs, loops:2 | offset:0, count:50 | N/A | N/A |
| └─TableReader_20 | 50.00 | 1416150.54 | 50 | root | | time:977.4µs, loops:1, cop_task: {num: 1, max: 928.1µs, proc_keys: 96, tot_proc: 418.5µs, tot_wait: 24.1µs, rpc_num: 1, rpc_time: 906.1µs, copr_cache_hit_ratio: 0.00, build_task_duration: 18.8s, max_distsql_concurrency: 2} | data:Limit_19 | 113.7 KB | N/A |
| └─Limit_19 | 50.00 | 21135338.17 | 50 | cop[tikv] | | tikv_task:{time:0s, loops:2}, scan_detail: {total_process_keys: 96, total_process_keys_size: 75762, total_keys: 147, get_snapshot_time: 3.07µs, rocksdb: {delete_skipped_count: 69, key_skipped_count: 310, block: {cache_hit_count: 19, read_count: 2, read_byte: 47.6 KB, read_time: 16.2µs}}} | offset:0, count:50 | N/A | N/A |
| └─Selection_18 | 50.00 | 21135338.17 | 96 | cop[tikv] | | tikv_task:{time:0s, loops:2} | eq(DB.Name0.m_id, ?) | N/A | N/A |
| └─TableRangeScan_17 | 50000.00 | 18640338.17 | 96 | cop[tikv] | table:Name0 | tikv_task:{time:0s, loops:2} | range:(?,+inf], keep order:true, stats:pseudo | N/A | N/A |