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

Optimize SELECT LIMIT SKIP query without ORDER BY #27

Open
arthurhsu opened this issue Nov 9, 2022 · 0 comments
Open

Optimize SELECT LIMIT SKIP query without ORDER BY #27

arthurhsu opened this issue Nov 9, 2022 · 0 comments

Comments

@arthurhsu
Copy link
Owner

Currently the LimitSkipByIndexPass will look for an existing IndexRangeScanStep in the execution tree

  • if it finds one, it will try to leverage it to perform limit/skip using the index
  • if it does not find one, it does nothing.

For this query, because there is no predicate, an IndexRangeScanStep does not exist in the tree, but instead of
concluding that the optimization is not applicable, we should check if the table has a primary key. If it does, then
use the primary key's index to perform LIMIT/SKIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant