-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: simplify generic query plans #133073
release-24.3: sql: simplify generic query plans #133073
Conversation
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, 1 of 1 files at r2, 1 of 1 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @mgartner)
408a149
to
06eb528
Compare
Fixes cockroachdb#132963 Release note (bug fix): A bug has been fixed that caused non-reusable query plans, e.g., plans for DDL and `SHOW ...` statements, to be cached and reused in future executions, possibly causing stale results to be returned. This bug only occurred when `plan_cache_mode` was set to `auto` or `force_generic_plan`, both of which are not currently the default settings.
An optimization code path from before the introduction of generic query plans has been removed. This code path remained in the codebase to de-risk the generic query plans backports. It is not needed in future versions. Release note: None
Release note: None
All fully-optimized memos that can be reused without re-optimization are now stored in `PreparedStatement.GenericMemo`. Prior to this commit, some fully-optimized memos were stored in `PreparedStatement.BaseMemo`. Release note: None
06eb528
to
602574c
Compare
Backport 4/4 commits from #131791.
/cc @cockroachdb/release
sql: do not cache non-reusable plans
Fixes #132963
Release note (bug fix): A bug has been fixed that caused non-reusable
query plans, e.g., plans for DDL and
SHOW ...
statements, to be cachedand reused in future executions, possibly causing stale results to be
returned. This bug only occurred when
plan_cache_mode
was set toauto
orforce_generic_plan
, both of which are not currently thedefault settings.
sql: remove legacy planning code path
An optimization code path from before the introduction of generic query
plans has been removed. This code path remained in the codebase to
de-risk the generic query plans backports. It is not needed in future
versions.
Release note: None
sql: remove unused context parameter in
reuseMemo
Release note: None
sql: simplify generic query plans
All fully-optimized memos that can be reused without re-optimization are
now stored in
PreparedStatement.GenericMemo
. Prior to this commit,some fully-optimized memos were stored in
PreparedStatement.BaseMemo
.Release note: None
Release justification: Refactoring that narrowly missed branch-cut.