-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Merge consequent FilterSteps. #64760
Conversation
This is an automated comment for commit d39f30d with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
@@ -45,6 +46,10 @@ void optimizePrewhere(Stack & stack, QueryPlan::Nodes &) | |||
if (!source_step_with_filter) | |||
return; | |||
|
|||
/// Prewhere is broken with StorageMerge and old analyzer. | |||
if (!source_step_with_filter->getContext()->getSettingsRef().allow_experimental_analyzer && typeid_cast<ReadFromMerge *>(source_step_with_filter)) |
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.
For example this one I've been investigated is related #63105
But what are other issues?
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.
That issue I'm trying to fix by recalculating child plans after prewhere info is updated #64893
src/Storages/StorageMerge.cpp
Outdated
@@ -1228,7 +1228,7 @@ QueryPlan ReadFromMerge::createPlanForTable( | |||
|
|||
if (allow_experimental_analyzer) | |||
{ | |||
InterpreterSelectQueryAnalyzer interpreter(modified_query_info.query_tree, | |||
InterpreterSelectQueryAnalyzer interpreter(modified_query_info.query_tree->toAST(), |
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.
Why do we need to convert to ast?
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Allow merging two consequent
FilterSteps
of a query plan. This improves filter-push-down optimization if the filter condition can be pushed down from the parent step.