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

Bug Report: EXISTS subqueries no longer apply LIMIT 1 #16149

Closed
arthurschreiber opened this issue Jun 13, 2024 · 0 comments · Fixed by #16153
Closed

Bug Report: EXISTS subqueries no longer apply LIMIT 1 #16149

arthurschreiber opened this issue Jun 13, 2024 · 0 comments · Fixed by #16153
Labels
Needs Triage This issue needs to be correctly labelled and triaged Type: Bug

Comments

@arthurschreiber
Copy link
Contributor

arthurschreiber commented Jun 13, 2024

Overview of the Issue

When subqueries were moved to the operator model, Vitess stopped applying LIMIT 1 on EXISTS subqueries.

See the comment in https://github.com/vitessio/vitess/pull/13750/files#r1337276087, and the surrounding test case changes for examples where the optimization was lost. It'd be great to bring this optimization back to ensure we don't end up loading thousands of rows when we already know the result as soon as the first row is returned.

Reproduction Steps

N/A

Binary Version

v18 and later

Operating System and Environment details

N/A

Log Fragments

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Triage This issue needs to be correctly labelled and triaged Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant