Skip Uinon step for usual queries.

This commit is contained in:
Nikolai Kochetov 2020-07-28 18:00:22 +03:00
parent 86e29b3371
commit aa7dc79832

View File

@ -175,6 +175,14 @@ Block InterpreterSelectWithUnionQuery::getSampleBlock(
void InterpreterSelectWithUnionQuery::buildQueryPlan(QueryPlan & query_plan)
{
size_t num_plans = nested_interpreters.size();
/// Skip union for single interpreter.
if (num_plans == 1)
{
nested_interpreters.front()->buildQueryPlan(query_plan);
return;
}
std::vector<QueryPlan> plans(num_plans);
DataStreams data_streams(num_plans);