Update 01213_optimize_skip_unused_shards_DISTINCT

This commit is contained in:
Azat Khuzhin 2021-08-25 08:39:41 +03:00
parent 37043b74bf
commit c3096805ac
2 changed files with 15 additions and 3 deletions

View File

@ -3,6 +3,11 @@ distributed_group_by_no_merge
1
optimize_skip_unused_shards
1
optimize_skip_unused_shards lack of WHERE
optimize_skip_unused_shards lack of WHERE (optimize_distributed_group_by_sharding_key=0)
0
1
optimize_skip_unused_shards lack of WHERE (optimize_distributed_group_by_sharding_key=1)
0
1
0
1

View File

@ -12,8 +12,15 @@ SELECT DISTINCT id FROM dist_01213 WHERE id = 1 SETTINGS distributed_group_by_no
SELECT 'optimize_skip_unused_shards';
SELECT DISTINCT id FROM dist_01213 WHERE id = 1 SETTINGS optimize_skip_unused_shards=1;
-- check that querying all shards is ok
SELECT 'optimize_skip_unused_shards lack of WHERE';
SELECT DISTINCT id FROM dist_01213 SETTINGS optimize_skip_unused_shards=1;
SELECT 'optimize_skip_unused_shards lack of WHERE (optimize_distributed_group_by_sharding_key=0)';
SELECT DISTINCT id FROM dist_01213 SETTINGS optimize_skip_unused_shards=1, optimize_distributed_group_by_sharding_key=0;
-- with optimize_distributed_group_by_sharding_key=1 there will be 4 rows,
-- since DISTINCT will be done on each shard separatelly, and initiator will
-- not do anything (since we use optimize_skip_unused_shards=1 that must
-- guarantee that the data had been INSERTed according to sharding key,
-- which is not our case, since we use one local table).
SELECT 'optimize_skip_unused_shards lack of WHERE (optimize_distributed_group_by_sharding_key=1)';
SELECT DISTINCT id FROM dist_01213 SETTINGS optimize_skip_unused_shards=1, optimize_distributed_group_by_sharding_key=1;
DROP TABLE local_01213;
DROP TABLE dist_01213;