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

The row count of selection in Limit->Selection->TableFullScan(mpp) is incorrect #36194

Closed
time-and-fate opened this issue Jul 13, 2022 · 0 comments · Fixed by #36195
Closed
Assignees
Labels
severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@time-and-fate
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
create table t(a int, b int);
alter table t set tiflash replica 1;
explain select * from t where a + 1 > 20 limit 100;

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

+--------------------------------+---------+--------------+---------------+--------------------------------+
| id                             | estRows | task         | access object | operator info                  |
+--------------------------------+---------+--------------+---------------+--------------------------------+
| Limit_10                       | 100.00  | root         |               | offset:0, count:100            |
| └─TableReader_21               | 100.00  | root         |               | data:ExchangeSender_20         |
|   └─ExchangeSender_20          | 100.00  | mpp[tiflash] |               | ExchangeType: PassThrough      |
|     └─Limit_19                 | 100.00  | mpp[tiflash] |               | offset:0, count:100            |
|       └─Selection_18           | 100.00  | mpp[tiflash] |               | gt(plus(test.t.a, 1), 20)      |
|         └─TableFullScan_17     | 125.00  | mpp[tiflash] | table:t       | keep order:false, stats:pseudo |
+--------------------------------+---------+--------------+---------------+--------------------------------+

3. What did you see instead (Required)

+--------------------------------+---------+--------------+---------------+--------------------------------+
| id                             | estRows | task         | access object | operator info                  |
+--------------------------------+---------+--------------+---------------+--------------------------------+
| Limit_10                       | 100.00  | root         |               | offset:0, count:100            |
| └─TableReader_21               | 100.00  | root         |               | data:ExchangeSender_20         |
|   └─ExchangeSender_20          | 100.00  | mpp[tiflash] |               | ExchangeType: PassThrough      |
|     └─Limit_19                 | 100.00  | mpp[tiflash] |               | offset:0, count:100            |
|       └─Selection_18           | 8000.00 | mpp[tiflash] |               | gt(plus(test.t.a, 1), 20)      |
|         └─TableFullScan_17     | 125.00  | mpp[tiflash] | table:t       | keep order:false, stats:pseudo |
+--------------------------------+---------+--------------+---------------+--------------------------------+

4. What is your TiDB version? (Required)

master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor 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.

1 participant