mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #39155 from amosbird/trivial-count-empty-set
Fix trivial count with empty set
This commit is contained in:
commit
d376a4b593
@ -1933,6 +1933,7 @@ void InterpreterSelectQuery::executeFetchColumns(QueryProcessingStage::Enum proc
|
||||
syntax_analyzer_result->optimize_trivial_count
|
||||
&& (settings.max_parallel_replicas <= 1)
|
||||
&& !settings.allow_experimental_query_deduplication
|
||||
&& !settings.empty_result_for_aggregation_by_empty_set
|
||||
&& storage
|
||||
&& storage->getName() != "MaterializedMySQL"
|
||||
&& !row_policy_filter
|
||||
|
@ -0,0 +1,9 @@
|
||||
drop table if exists test;
|
||||
|
||||
create table test(a Int64) Engine=MergeTree order by tuple();
|
||||
|
||||
set optimize_trivial_count_query=1, empty_result_for_aggregation_by_empty_set=1;
|
||||
|
||||
select count() from test;
|
||||
|
||||
drop table test;
|
Loading…
Reference in New Issue
Block a user