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 calculation of cardinality estimation is wrong in some cases #39593

Closed
Reminiscent opened this issue Dec 2, 2022 · 0 comments · Fixed by #40472
Closed

The calculation of cardinality estimation is wrong in some cases #39593

Reminiscent opened this issue Dec 2, 2022 · 0 comments · Fixed by #40472
Assignees
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@Reminiscent
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

We shouldn't scale the totalCount here, we only scale the expBackoffCnt here.

You can reproduce it through
create tablet t(id int, a int, b int, primary key(a, b) nonclustered);
select * from t where id in (..); // Here the number of in expression should be as much as possible.

And the modifyCount != 0.

You can run the above SQL and check the estimate row count of the dataSource operator which use the index.

@Reminiscent Reminiscent added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner labels Dec 2, 2022
@seiya-annie seiya-annie added the affects-4.0 This bug affects 4.0.x versions. label Dec 14, 2022
@seiya-annie seiya-annie added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 labels Dec 22, 2022
@time-and-fate time-and-fate removed affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. labels Jan 10, 2023
@VelocityLight VelocityLight added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. labels Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
5 participants