tidb版本 4.0.13
简单的索引等值查询预期应该是几毫米就能出结果,但是执行了5min
id task estRows operator info actRows execution info memory disk
Limit_9 root 0 offset:0, count:1 1 time:4m43.3s, loops:2 N/A N/A
└─IndexLookUp_22 root 0 1 time:4m43.3s, loops:1, index_task: {total_time: 4m43.3s, fetch_handle: 587.3ms, build: 704.6µs, wait: 4m42.7s}, table_task: {total_time: 19m27.4s, num: 255, concurrency: 4} 52.7 MB N/A
├─IndexRangeScan_18 cop[tikv] 0 table:t_behavior_flow, index:idx_bid(bid), range:[66,66], keep order:false 5351797 time:534.2ms, loops:4865, cop_task: {num: 6, max: 17.9s, min: 530.5ms, avg: 4.63s, p95: 17.9s, max_proc_keys: 960000, p95_proc_keys: 960000, tot_proc: 27.6s, tot_wait: 1ms, rpc_num: 6, rpc_time: 27.8s, copr_cache: disabled}, tikv_task:{proc max:662ms, min:439ms, p80:614ms, p95:662ms, iters:5253, tasks:6}, scan_detail: {total_process_keys: 5351797, total_keys: 5351803} N/A N/A
└─Limit_21 cop[tikv] 0 offset:0, count:1 1 time:19m23.9s, loops:256, cop_task: {num: 274, max: 10.3s, min: 20.5ms, avg: 4.35s, p95: 8.9s, max_proc_keys: 20992, p95_proc_keys: 20480, tot_proc: 18m53.6s, tot_wait: 54.8s, rpc_num: 274, rpc_time: 19m51.9s, copr_cache: disabled}, tikv_task:{proc max:1.24s, min:1ms, p80:996ms, p95:1.16s, iters:6179, tasks:274}, scan_detail: {total_process_keys: 4953849, total_keys: 6338033} N/A N/A
└─Selection_20 cop[tikv] 0 eq(dbwww58com_spamrw.t_behavior_flow.uid, 34354655465765674) 1 tikv_task:{proc max:1.24s, min:1ms, p80:996ms, p95:1.16s, iters:6179, tasks:274} N/A N/A
└─TableRowIDScan_19 cop[tikv] 0 table:t_behavior_flow, keep order:false 4953849 tikv_task:{proc max:1.24s, min:1ms, p80:995ms, p95:1.16s, iters:6179, tasks:274} N/A N/A
这期间tikv节点cpu基本算被打满,持续时间大概15min,15min内的慢查询记录的都是这类sql【索引等值查询】,15min后自己恢复了