-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18483 from ClickHouse/backport/20.11/18381
Backport #18381 to 20.11: Restrict merges from wide to compact parts
- Loading branch information
Showing
4 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
tests/queries/0_stateless/01606_merge_from_wide_to_compact.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
all_1_1_0 Wide | ||
all_2_2_0 Wide | ||
all_3_3_0 Wide | ||
all_1_3_1 Wide | ||
300000 | ||
all_1_3_1 Wide | ||
all_4_4_0 Compact | ||
all_1_4_2 Wide | ||
400000 |
36 changes: 36 additions & 0 deletions
36
tests/queries/0_stateless/01606_merge_from_wide_to_compact.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
DROP TABLE IF EXISTS wide_to_comp; | ||
|
||
CREATE TABLE wide_to_comp (a Int, b Int, c Int) | ||
ENGINE = MergeTree ORDER BY a | ||
settings vertical_merge_algorithm_min_rows_to_activate = 1, | ||
vertical_merge_algorithm_min_columns_to_activate = 1, | ||
min_bytes_for_wide_part = 0; | ||
|
||
SYSTEM STOP merges wide_to_comp; | ||
|
||
INSERT INTO wide_to_comp SELECT number, number, number FROM numbers(100000); | ||
INSERT INTO wide_to_comp SELECT number, number, number FROM numbers(100000); | ||
INSERT INTO wide_to_comp SELECT number, number, number FROM numbers(100000); | ||
|
||
SELECT name, part_type FROM system.parts WHERE table = 'wide_to_comp' AND database = currentDatabase() AND active ORDER BY name; | ||
|
||
ALTER TABLE wide_to_comp MODIFY setting min_rows_for_wide_part = 10000000; | ||
SYSTEM START merges wide_to_comp; | ||
OPTIMIZE TABLE wide_to_comp FINAL; | ||
|
||
SELECT name, part_type FROM system.parts WHERE table = 'wide_to_comp' AND database = currentDatabase() AND active ORDER BY name; | ||
SELECT count() FROM wide_to_comp WHERE not ignore(*); | ||
|
||
SYSTEM STOP merges wide_to_comp; | ||
INSERT INTO wide_to_comp SELECT number, number, number FROM numbers(100000); | ||
|
||
SELECT name, part_type FROM system.parts WHERE table = 'wide_to_comp' AND database = currentDatabase() AND active ORDER BY name; | ||
|
||
ALTER TABLE wide_to_comp MODIFY setting min_rows_for_wide_part = 10000000; | ||
SYSTEM START merges wide_to_comp; | ||
OPTIMIZE TABLE wide_to_comp FINAL; | ||
|
||
SELECT name, part_type FROM system.parts WHERE table = 'wide_to_comp' AND database = currentDatabase() AND active ORDER BY name; | ||
SELECT count() FROM wide_to_comp WHERE not ignore(*); | ||
|
||
DROP TABLE wide_to_comp; |