2020-02-21 17:48:37 +00:00
|
|
|
drop table if exists da_memory_efficient_shard;
|
|
|
|
create table da_memory_efficient_shard(A Int64, B Int64) Engine=MergeTree order by A partition by B % 2;
|
2020-02-21 19:03:45 +00:00
|
|
|
insert into da_memory_efficient_shard select number, number from numbers(100000);
|
2020-02-21 17:48:37 +00:00
|
|
|
|
|
|
|
set distributed_aggregation_memory_efficient = 1, group_by_two_level_threshold = 1, group_by_two_level_threshold_bytes=1;
|
|
|
|
|
|
|
|
select sum(a) from (SELECT B, uniqExact(A) a FROM remote('localhost,127.0.0.1', currentDatabase(), da_memory_efficient_shard) GROUP BY B);
|
|
|
|
|
|
|
|
drop table if exists da_memory_efficient_shard;
|