pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.37k stars 5.86k forks source link

`IndexLookUpExec` has an extra loop which is meaningless #56407

Open Defined2014 opened 1 month ago

Defined2014 commented 1 month ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t (pk int auto_increment, col int, index idx (col));
insert into t(col) values (1);
explain analyze select * from t where col = 1;

2. What did you expect to see? (Required)

The loops in execution info of IndexRangeScan equals to 2

... time:1.29ms, loops:2 ...

3. What did you see instead (Required)

The loops in execution info of IndexRangeScan equals to 3

... time:2.95ms, loops:3 ...

4. What is your TiDB version? (Required)

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                      |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.4.0-alpha-290-gf2ed8228ff
Edition: Community
Git Commit Hash: f2ed8228ffc0cee144453ab334cdfe4aa5dac4a5
Git Branch: HEAD
UTC Build Time: 2024-09-27 01:12:36
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
yibin87 commented 1 month ago

/assign @yibin87