-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
release-24.3: sql: fix edge case causing suboptimal generic query plans #135278
Conversation
This commit fixes a bug that caused suboptimal generic query plans to be planned under all of the following conditions: 1. `plan_cache_mode` was set to `force_custom_plan` (the default). 2. A query was prepared and an ideal generic query plan was selected (i.e., it used the placeholder fast path). 3. New stats were collected, making the original plan stale and increasing the estimated row count of the root expression beyond `maxRowCountForPlaceholderFastPath` (10). 4. The prepared query was re-executed. Fixes #135151 There is no release note because this bug does not exist in any releases. Release note: None
db0567e
to
1c2113b
Compare
Thanks for opening a backport. Please check the backport criteria before merging:
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
Also, please add a brief release justification to the body of your PR to justify this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball, @mgartner, and @michae2)
Backport 1/1 commits from #135228 on behalf of @mgartner.
/cc @cockroachdb/release
This commit fixes a bug that caused suboptimal generic query plans to be
planned under all of the following conditions:
plan_cache_mode
was set toforce_custom_plan
(the default).(i.e., it used the placeholder fast path).
increasing the estimated row count of the root expression beyond
maxRowCountForPlaceholderFastPath
(10).Fixes #135151
There is no release note because this bug does not exist in any
releases.
Release note: None
Release justification: Critical bug fix.