mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
fix
This commit is contained in:
parent
6d48962ca0
commit
55e0c668ae
@ -1515,15 +1515,6 @@ static void buildIndexes(
|
||||
|
||||
void ReadFromMergeTree::applyFilters(ActionDAGNodes added_filter_nodes)
|
||||
{
|
||||
/// Sometimes a really dumb problem may happen.
|
||||
/// For ReadFromMerge for example we may recursively call `applyFilters` for child reading steps (with no filters added so far).
|
||||
/// Then later `optimizePrimaryKeyCondition` will try to apply filters to those child reading steps, but with no luck,
|
||||
/// because we already made an `applyFilters` call that could lead to indexes initialization few lines below.
|
||||
/// So effectively the right set of filters will be just ignored.
|
||||
/// This is not an ultimate solution, of course, we're better to have more structured way of applying filters.
|
||||
if (added_filter_nodes.nodes.empty())
|
||||
return;
|
||||
|
||||
if (!indexes)
|
||||
{
|
||||
filter_actions_dag = ActionsDAG::buildFilterActionsDAG(added_filter_nodes.nodes, query_info.buildNodeNameToInputNodeColumn());
|
||||
|
@ -1573,14 +1573,8 @@ QueryPlanRawPtrs ReadFromMerge::getChildPlans()
|
||||
|
||||
QueryPlanRawPtrs plans;
|
||||
for (auto & child_plan : *child_plans)
|
||||
{
|
||||
if (child_plan.plan.isInitialized())
|
||||
{
|
||||
/// So we will see the optimized plan in EXPLAIN output
|
||||
child_plan.plan.optimize(QueryPlanOptimizationSettings::fromContext(context));
|
||||
plans.push_back(&child_plan.plan);
|
||||
}
|
||||
}
|
||||
|
||||
return plans;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user