-
Notifications
You must be signed in to change notification settings - Fork 5.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
Make ExtractEqAndInCondition
use conditions without user vars to build range for plan cache
#34561
Labels
epic/plan-cache
sig/planner
SIG: Planner
type/enhancement
The issue or PR belongs to an enhancement.
Comments
time-and-fate
added
type/enhancement
The issue or PR belongs to an enhancement.
sig/planner
SIG: Planner
epic/plan-cache
labels
May 11, 2022
An example:
And
A better choice of the second execution is to use |
Fixed by #28944 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
epic/plan-cache
sig/planner
SIG: Planner
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement
Currently, in
ExtractEqAndInCondition()
, if user variables can possibly affect the correctness of the plan for plan cache, we will give up building any access conditions (which will become table/index range scan), and mark all conditions as filter conditions (which will become filters in the selection operator).However, even when there're user variables in some conditions, we can use the conditions that don't contain user variables to build access conditions. This will avoid some unnecessary table/index full scans when the plan cache is enabled.
The text was updated successfully, but these errors were encountered: