mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Fix optimize_trivial_count_query for queries with GROUP BY
Fixes: 00341_squashing_insert_select2
This commit is contained in:
parent
85df027651
commit
3d3a82543a
@ -1064,7 +1064,7 @@ void InterpreterSelectQuery::executeFetchColumns(
|
||||
auto check_trivial_count_query = [&]() -> std::optional<AggregateDescription>
|
||||
{
|
||||
if (!settings.optimize_trivial_count_query || !syntax_analyzer_result->maybe_optimize_trivial_count || !storage
|
||||
|| query.sampleSize() || query.sampleOffset() || query.final() || query.prewhere() || query.where()
|
||||
|| query.sampleSize() || query.sampleOffset() || query.final() || query.prewhere() || query.where() || query.groupBy()
|
||||
|| !query_analyzer->hasAggregation() || processing_stage != QueryProcessingStage::FetchColumns)
|
||||
return {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user