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

Improve row count estimation for Limit/TopN #26088

Closed
Tracked by #26085
time-and-fate opened this issue Jul 9, 2021 · 2 comments · Fixed by #26445
Closed
Tracked by #26085

Improve row count estimation for Limit/TopN #26088

time-and-fate opened this issue Jul 9, 2021 · 2 comments · Fixed by #26445
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@time-and-fate
Copy link
Member

Enhancement

Currently, when doing row count estimation for the index/table scan in a SQL with LIMIT, we'll adjust the row count according to the LIMIT number and the correlation from statistics. This is a good strategy but sometimes it makes the planner choose TableScan when it should choose IndexScan, and the SQL execution becomes very slow. We'll try to fix it.

@time-and-fate time-and-fate added the type/enhancement The issue or PR belongs to an enhancement. label Jul 9, 2021
@time-and-fate
Copy link
Member Author

/sig planner

@qw4990
Copy link
Contributor

qw4990 commented Jul 21, 2021

Please see #26445 for more examples and details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants