This commit is contained in:
Nikita Taranov 2024-06-12 20:49:26 +01:00
parent 6d48962ca0
commit 55e0c668ae
2 changed files with 0 additions and 15 deletions

View File

@ -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());

View File

@ -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;
}