Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain results show stats:pseudo in operator info though it uses true stats #27083

Closed
xuyifangreeneyes opened this issue Aug 10, 2021 · 3 comments · Fixed by #27161
Closed
Assignees
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@xuyifangreeneyes
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table if exists t;
create table t(a int primary key, b int, c int, index idx_b(b));
insert into t values (1,2,3), (4,5,6), (7,8,9), (10, 11, 12), (13,14,15), (16, 17, 18);
analyze table t;
explain format = 'brief' select * from t use index (idx_b) where b = 2 limit 1;

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

mysql> explain format = 'brief' select * from t use index (idx_b) where b = 2 limit 1;
+-----------------------------+---------+-----------+-------------------------+-----------------------------------+
| id                          | estRows | task      | access object           | operator info                     |
+-----------------------------+---------+-----------+-------------------------+-----------------------------------+
| IndexLookUp                 | 1.00    | root      |                         | limit embedded(offset:0, count:1) |
| ├─Limit(Build)              | 1.00    | cop[tikv] |                         | offset:0, count:1                 |
| │ └─IndexRangeScan          | 1.00    | cop[tikv] | table:t, index:idx_b(b) | range:[2,2], keep order:false     |
| └─TableRowIDScan(Probe)     | 1.00    | cop[tikv] | table:t                 | keep order:false                  |
+-----------------------------+---------+-----------+-------------------------+-----------------------------------+
4 rows in set (0.01 sec)

3. What did you see instead (Required)

mysql> explain format = 'brief' select * from t use index (idx_b) where b = 2 limit 1;
+-----------------------------+---------+-----------+-------------------------+-----------------------------------+
| id                          | estRows | task      | access object           | operator info                     |
+-----------------------------+---------+-----------+-------------------------+-----------------------------------+
| IndexLookUp                 | 1.00    | root      |                         | limit embedded(offset:0, count:1) |
| ├─Limit(Build)              | 1.00    | cop[tikv] |                         | offset:0, count:1                 |
| │ └─IndexRangeScan          | 1.00    | cop[tikv] | table:t, index:idx_b(b) | range:[2,2], keep order:false     |
| └─TableRowIDScan(Probe)     | 1.00    | cop[tikv] | table:t                 | keep order:false, stats:pseudo    |
+-----------------------------+---------+-----------+-------------------------+-----------------------------------+
4 rows in set (0.01 sec)

4. What is your TiDB version? (Required)

mysql> SELECT tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@xuyifangreeneyes xuyifangreeneyes added the type/bug The issue is confirmed as a bug. label Aug 10, 2021
@xuyifangreeneyes
Copy link
Contributor Author

/sig planner

@ti-chi-bot ti-chi-bot added the sig/planner SIG: Planner label Aug 10, 2021
@xuyifangreeneyes
Copy link
Contributor Author

/assign

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants