key_skipped_count 记录已经失效了(删除标记之后未释放),会被跳过
第一次对这个表进行删除(之前没有删除过数据)key_skipped_count 是1696 这个怎么理解呢?
mysql> explain analyze delete from sbtest1 limit 1000;
±-----------------------------±--------±--------±----------±--------------±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±-------------------------------±---------±-----+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
±-----------------------------±--------±--------±----------±--------------±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±-------------------------------±---------±-----+
| Delete_4 | N/A | 0 | root | | time:14.3ms, loops:1 | N/A | 247.5 KB | N/A |
| └─Limit_8 | 1000.00 | 1000 | root | | time:9.89ms, loops:2 | offset:0, count:1000 | N/A | N/A |
| └─TableReader_12 | 1000.00 | 1000 | root | | time:9.88ms, loops:1, cop_task: {num: 3, max: 4.11ms, min: 2.75ms, avg: 3.22ms, p95: 4.11ms, max_proc_keys: 992, p95_proc_keys: 992, tot_proc: 1ms, rpc_num: 3, rpc_time: 9.64ms, copr_cache_hit_ratio: 0.00, distsql_concurrency: 1} | data:Limit_11 | 302.7 KB | N/A |
| └─Limit_11 | 1000.00 | 1696 | cop[tikv] | | tikv_task:{proc max:2ms, min:0s, avg: 1.33ms, p80:2ms, p95:2ms, iters:12, tasks:3}, scan_detail: {total_process_keys: 1696, total_process_keys_size: 379904, total_keys: 1699, get_snapshot_time: 832.6µs, rocksdb: {key_skipped_count: 1696, block: {cache_hit_count: 25, read_count: 2, read_byte: 52.2 KB, read_time: 394.1µs}}} | offset:0, count:1000 | N/A | N/A |
| └─TableFullScan_10 | 1000.00 | 1696 | cop[tikv] | table:sbtest1 | tikv_task:{proc max:2ms, min:0s, avg: 1.33ms, p80:2ms, p95:2ms, iters:12, tasks:3} | keep order:false, stats:pseudo | N/A | N/A |
±-----------------------------±--------±--------±----------±--------------±--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±-------------------------------±---------±-----+
5 rows in set (0.10 sec)