执行计划的确是有变化:
sql:
explain SELECT xxx FROM `t_user` WHERE `uid` = 123 LIMIT 1000\G;
故障中执行计划
id task estRows operator info actRows execution info memory disk
Projection_7 root 1000 d_database.t_user.xxx 2 2 time:601.5ms, loops:2, Concurrency:OFF 3.66 KB N/A
└─IndexLookUp_17 root 1000 limit embedded(offset:0, count:1000) 2 time:601.5ms, loops:2, index_task: {total_time: 584.4ms, fetch_handle: 584.4ms, build: 1.21µs, wait: 2.79µs}, table_task: {total_time: 16.9ms, num: 1, concurrency: 5} 11.7 KB N/A
├─Limit_16 cop[tikv] 1000 offset:0, count:1000 2 time:584.4ms, loops:3, cop_task: {num: 1, max: 584.2ms, proc_keys: 2, rpc_num: 1, rpc_time: 584.2ms, copr_cache_hit_ratio: 0.00}, tikv_task:{time:0s, loops:1}, scan_detail: {total_process_keys: 2, total_process_keys_size: 92, total_keys: 4, rocksdb: {delete_skipped_count: 0, key_skipped_count: 3, block: {cache_hit_count: 10, read_count: 0, read_byte: 0 Bytes}}} N/A N/A
│ └─IndexRangeScan_14 cop[tikv] 1000 table:t_user, index:uid(uid), range:[1595527641,1595527641], keep order:false, stats:pseudo 2 tikv_task:{time:0s, loops:1} N/A N/A
└─TableRowIDScan_15 cop[tikv] 1000 table:t_user, keep order:false, stats:pseudo 2 time:16.8ms, loops:2, cop_task: {num: 2, max: 16.7ms, min: 13ms, avg: 14.9ms, p95: 16.7ms, max_proc_keys: 1, p95_proc_keys: 1, rpc_num: 2, rpc_time: 29.7ms, copr_cache_hit_ratio: 0.00}, tikv_task:{proc max:0s, min:0s, p80:0s, p95:0s, iters:2, tasks:2}, scan_detail: {total_process_keys: 2, total_process_keys_size: 344, total_keys: 2, rocksdb: {delete_skipped_count: 0, key_skipped_count: 0, block: {cache_hit_count: 19, read_count: 0, read_byte: 0 Bytes}}} N/A N/A
目前执行计划
*************************** 1. row ***************************
id: Projection_7
estRows: 1.38
task: root
access object:
operator info: d_database.xxx
*************************** 2. row ***************************
id: └─IndexLookUp_17
estRows: 1.38
task: root
access object:
operator info: limit embedded(offset:0, count:1000)
*************************** 3. row ***************************
id: ├─Limit_16(Build)
estRows: 1.38
task: cop[tikv]
access object:
operator info: offset:0, count:1000
*************************** 4. row ***************************
id: │ └─IndexRangeScan_14
estRows: 1.38
task: cop[tikv]
access object: table:t_user, index:uid(uid)
operator info: range:[1595527641,1595527641], keep order:false
*************************** 5. row ***************************
id: └─TableRowIDScan_15(Probe)
estRows: 1.38
task: cop[tikv]
access object: table:t_user
operator info: keep order:false