mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Planner filter push down optimization fix
This commit is contained in:
parent
6b2adc1ec2
commit
4ddf1b0f48
@ -333,8 +333,19 @@ size_t tryPushDownFilter(QueryPlan::Node * parent_node, QueryPlan::Nodes & nodes
|
|||||||
// {
|
// {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (auto updated_steps = simplePushDownOverStep<SortingStep>(parent_node, nodes, child))
|
if (auto * sorting = typeid_cast<SortingStep *>(child.get()))
|
||||||
return updated_steps;
|
{
|
||||||
|
const auto & sort_description = sorting->getSortDescription();
|
||||||
|
auto sort_description_it = std::find_if(sort_description.begin(), sort_description.end(), [&](auto & sort_column_description)
|
||||||
|
{
|
||||||
|
return sort_column_description.column_name == filter->getFilterColumnName();
|
||||||
|
});
|
||||||
|
bool can_remove_filter = sort_description_it == sort_description.end();
|
||||||
|
|
||||||
|
Names allowed_inputs = child->getOutputStream().header.getNames();
|
||||||
|
if (auto updated_steps = tryAddNewFilterStep(parent_node, nodes, allowed_inputs, can_remove_filter))
|
||||||
|
return updated_steps;
|
||||||
|
}
|
||||||
|
|
||||||
if (auto updated_steps = simplePushDownOverStep<CreateSetAndFilterOnTheFlyStep>(parent_node, nodes, child))
|
if (auto updated_steps = simplePushDownOverStep<CreateSetAndFilterOnTheFlyStep>(parent_node, nodes, child))
|
||||||
return updated_steps;
|
return updated_steps;
|
||||||
|
Loading…
Reference in New Issue
Block a user