Fix flaky test

This commit is contained in:
alesapin 2020-09-12 10:07:08 +03:00
parent 1c2ca4e773
commit ecbcbad0d9
2 changed files with 32 additions and 29 deletions

View File

@ -1,24 +1,24 @@
CREATE TABLE default.recompression_table\n(\n `dt` DateTime,\n `key` UInt64,\n `value` String\n)\nENGINE = MergeTree()\nPARTITION BY key\nORDER BY tuple()\nTTL dt + toIntervalMonth(1) RECOMPRESS CODEC(ZSTD(17)), dt + toIntervalYear(1) RECOMPRESS CODEC(LZ4HC(10))\nSETTINGS min_rows_for_wide_part = 0, min_bytes_for_wide_part = 0, index_granularity = 8192
3000
1_1_1_0 LZ4
2_2_2_0 LZ4
3_3_3_0 LZ4
1_1_1_1 LZ4
2_2_2_1 ZSTD(17)
3_3_3_1 LZ4HC(10)
1_1_1 LZ4
2_2_2 LZ4
3_3_3 LZ4
1_1_1 LZ4
2_2_2 ZSTD(17)
3_3_3 LZ4HC(10)
CREATE TABLE default.recompression_table\n(\n `dt` DateTime,\n `key` UInt64,\n `value` String\n)\nENGINE = MergeTree()\nPARTITION BY key\nORDER BY tuple()\nTTL dt + toIntervalDay(1) RECOMPRESS CODEC(ZSTD(12))\nSETTINGS min_rows_for_wide_part = 0, min_bytes_for_wide_part = 0, index_granularity = 8192
1_1_1_1_4 LZ4
2_2_2_1_4 ZSTD(17)
3_3_3_1_4 LZ4HC(10)
1_1_1_2_4 LZ4
2_2_2_2_4 ZSTD(12)
3_3_3_2_4 ZSTD(12)
1_1_1_2_4 ['plus(dt, toIntervalDay(1))']
2_2_2_2_4 ['plus(dt, toIntervalDay(1))']
3_3_3_2_4 ['plus(dt, toIntervalDay(1))']
1_1_1_0 LZ4
2_2_2_0 LZ4
3_3_3_0 LZ4
1_1_1_0_4 LZ4
2_2_2_0_4 ZSTD(12)
3_3_3_0_4 ZSTD(12)
1_1_1 LZ4
2_2_2 ZSTD(17)
3_3_3 LZ4HC(10)
1_1_1 LZ4
2_2_2 ZSTD(12)
3_3_3 ZSTD(12)
1_1_1 ['plus(dt, toIntervalDay(1))']
2_2_2 ['plus(dt, toIntervalDay(1))']
3_3_3 ['plus(dt, toIntervalDay(1))']
1_1_1 LZ4
2_2_2 LZ4
3_3_3 LZ4
1_1_1 LZ4
2_2_2 ZSTD(12)
3_3_3 ZSTD(12)

View File

@ -24,25 +24,27 @@ INSERT INTO recompression_table SELECT now() - INTERVAL 2 YEAR, 3, toString(numb
SELECT COUNT() FROM recompression_table;
SELECT name, default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
SELECT substring(name, 1, length(name) - 2), default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
OPTIMIZE TABLE recompression_table FINAL;
SELECT name, default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
-- merge level and mutation in part name is not important
SELECT substring(name, 1, length(name) - 2), default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
ALTER TABLE recompression_table MODIFY TTL dt + INTERVAL 1 DAY RECOMPRESS CODEC(ZSTD(12)) SETTINGS mutations_sync = 2;
SHOW CREATE TABLE recompression_table;
SELECT name, default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
SELECT substring(name, 1, length(name) - 4), default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
SYSTEM START TTL MERGES recompression_table;
-- Additional merge can happen here
OPTIMIZE TABLE recompression_table FINAL;
SELECT name, default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
-- merge level and mutation in part name is not important
SELECT substring(name, 1, length(name) - 4), default_compression_codec FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
SELECT name, recompression_ttl_info.expression FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
SELECT substring(name, 1, length(name) - 4), recompression_ttl_info.expression FROM system.parts WHERE table = 'recompression_table' and active = 1 and database = currentDatabase() ORDER BY name;
DROP TABLE IF EXISTS recompression_table;
@ -66,10 +68,11 @@ INSERT INTO recompression_table_compact SELECT now() - INTERVAL 2 MONTH, 2, toSt
INSERT INTO recompression_table_compact SELECT now() - INTERVAL 2 YEAR, 3, toString(number) from numbers(2000, 1000);
SELECT name, default_compression_codec FROM system.parts WHERE table = 'recompression_table_compact' and active = 1 and database = currentDatabase() ORDER BY name;
SELECT substring(name, 1, length(name) - 2), default_compression_codec FROM system.parts WHERE table = 'recompression_table_compact' and active = 1 and database = currentDatabase() ORDER BY name;
ALTER TABLE recompression_table_compact MODIFY TTL dt + INTERVAL 1 MONTH RECOMPRESS CODEC(ZSTD(12)) SETTINGS mutations_sync = 2; -- mutation affect all columns, so codec changes
SELECT name, default_compression_codec FROM system.parts WHERE table = 'recompression_table_compact' and active = 1 and database = currentDatabase() ORDER BY name;
-- merge level and mutation in part name is not important
SELECT substring(name, 1, length(name) - 4), default_compression_codec FROM system.parts WHERE table = 'recompression_table_compact' and active = 1 and database = currentDatabase() ORDER BY name;
DROP TABLE recompression_table_compact;