diff --git a/src/Processors/QueryPlan/QueryPlan.cpp b/src/Processors/QueryPlan/QueryPlan.cpp index cbbd5bf5efb..66e22d1704e 100644 --- a/src/Processors/QueryPlan/QueryPlan.cpp +++ b/src/Processors/QueryPlan/QueryPlan.cpp @@ -63,7 +63,7 @@ void QueryPlan::unitePlans(QueryPlanStepPtr step, std::vector plans) } for (auto & plan : plans) - nodes.insert(nodes.end(), plan.nodes.begin(), plan.nodes.end()); + nodes.splice(nodes.end(), std::move(plan.nodes)); nodes.emplace_back(Node{.step = std::move(step)}); root = &nodes.back();