【 TiDB 使用环境】生产环境 /测试/ Poc
Poc
【 TiDB 版本】
5.1.4
【遇到的问题】
为什么下面这个sql limit 1,但是执行计划里tikv层的 actRows 是7 (Limit_28(Build) )
这个不应该是 1 吗?帮忙看下,谢谢
desc analyze SELECT status
, expiry_time
FROM modell_var_tab force index (idx_tag_entity) WHERE tag_id = 8884146564707019816 AND (entity_id >= 470781680 AND entity_type >= ‘user’ ) ORDER BY entity_id, entity_type LIMIT 1;
±-------------------------------------±--------±--------±----------±---------------------------------------------------------------------------±---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±--------±-----+
| id | estRows | actRows | task | access object | execution info
| operator info
| memory | disk |
±-------------------------------------±--------±--------±----------±---------------------------------------------------------------------------±---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±--------±-----+
| Projection_8 | 0.84 | 1 | root | | time:3.27ms, loops:2, Concurrency:OFF
| userdb_tes_mode_aa_db.modell_var_tab.status, userdb_tes_mode_aa_db.modell_var_tab.expiry_time
| 2.07 KB | N/A |
| └─Limit_14 | 0.84 | 1 | root | | time:3.26ms, loops:2
| offset:0, count:1
| N/A | N/A |
| └─Projection_30 | 0.84 | 1 | root | | time:3.26ms, loops:1, Concurrency:OFF | userdb_tes_mode_aa_db.modell_var_tab.entity_id, userdb_tes_mode_aa_db.modell_var_tab.entity_type, userdb_tes_mode_aa_db.modell_var_tab.tag_id, userdb_tes_mode_aa_db.modell_var_tab.status, userdb_tes_mode_aa_db.modell_var_tab.expiry_time | 2.43 KB | N/A |
| └─IndexLookUp_29 | 0.84 | 1 | root | | time:3.26ms, loops:1, index_task: {total_time: 1.11ms, fetch_handle: 1.1ms, build: 3.82µs, wait: 3.14µs}, table_task: {total_time: 15.4ms, num: 3, concurrency: 5} | | 7.48 KB | N/A |
| ├─Limit_28(Build) | 0.84 | 7 | cop[tikv] | | time:1.1ms, loops:4, cop_task: {num: 7, max: 1.07ms, min: 854µs, avg: 953.3µs, p95: 1.07ms, max_proc_keys: 32, p95_proc_keys: 32, tot_proc: 2ms, tot_wait: 1ms, rpc_num: 7, rpc_time: 6.6ms, copr_cache_hit_ratio: 0.00}, tikv_task:{proc max:1ms, min:0s, p80:1ms, p95:1ms, iters:7, tasks:7}, scan_detail: {total_process_keys: 224, total_keys: 231, rocksdb: {delete_skipped_count: 0, key_skipped_count: 224, block: {cache_hit_count: 91, read_count: 1, read_byte: 31.2 KB}}} | offset:0, count:1 | N/A | N/A |
| │ └─Selection_27 | 0.84 | 224 | cop[tikv] | | tikv_task:{proc max:1ms, min:0s, p80:1ms, p95:1ms, iters:7, tasks:7} | ge(userdb_tes_mode_aa_db.modell_var_tab.entity_type, “user”) | N/A | N/A |
| │ └─IndexRangeScan_25 | 0.84 | 224 | cop[tikv] | table:modell_var_tab, index:idx_tag_entity(tag_id, entity_id, entity_type) | tikv_task:{proc max:1ms, min:0s, p80:1ms, p95:1ms, iters:7, tasks:7} | range:[8884146564707019816 470781680,8884146564707019816 +inf], keep order:true | N/A | N/A |
| └─TableRowIDScan_26(Probe) | 0.84 | 7 | cop[tikv] | table:modell_var_tab | time:1.82ms, loops:6, cop_task: {num: 7, max: 601.6µs, min: 518.9µs, avg: 564.6µs, p95: 601.6µs, max_proc_keys: 1, p95_proc_keys: 1, rpc_num: 7, rpc_time: 3.89ms, copr_cache_hit_ratio: 0.00}, tikv_task:{proc max:0s, min:0s, p80:0s, p95:0s, iters:7, tasks:7}, scan_detail: {total_process_keys: 7, total_keys: 7, rocksdb: {delete_skipped_count: 0, key_skipped_count: 0, block: {cache_hit_count: 84, read_count: 0, read_byte: 0 Bytes}}} | keep order:false, stats:pseudo | N/A | N/A |
±-------------------------------------±--------±--------±----------±---------------------------------------------------------------------------±---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------±--------±-----+
【复现路径】做过哪些操作出现的问题
【问题现象及影响】
【附件】
请提供各个组件的 version 信息,如 cdc/tikv,可通过执行 cdc version/tikv-server --version 获取。