Disable read-in-order optimization in case of projections.

This commit is contained in:
Nikolai Kochetov 2021-04-23 17:18:31 +03:00 committed by Amos Bird
parent 672cfedd13
commit c2396c5144
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4

View File

@ -1822,7 +1822,7 @@ void InterpreterSelectQuery::executeFetchColumns(QueryProcessingStage::Enum proc
/// Create optimizer with prepared actions.
/// Maybe we will need to calc input_order_info later, e.g. while reading from StorageMerge.
if (analysis_result.optimize_read_in_order || analysis_result.optimize_aggregation_in_order)
if ((analysis_result.optimize_read_in_order || analysis_result.optimize_aggregation_in_order) && !query_info.aggregate_projection)
{
if (analysis_result.optimize_read_in_order)
query_info.order_optimizer = std::make_shared<ReadInOrderOptimizer>(