ClickHouse/tests/queries/0_stateless/01375_compact_parts_codecs.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.8 KiB
MySQL
Raw Normal View History

2022-12-14 03:21:24 +00:00
-- Tags: no-parallel, no-random-merge-tree-settings
2021-09-12 12:35:27 +00:00
2020-07-07 00:15:02 +00:00
DROP TABLE IF EXISTS codecs;
2022-12-14 03:21:24 +00:00
CREATE TABLE codecs (id UInt32, val UInt32, s String)
2020-07-07 00:15:02 +00:00
ENGINE = MergeTree ORDER BY id
2023-05-07 22:37:10 +00:00
SETTINGS min_rows_for_wide_part = 10000, ratio_of_defaults_for_sparse_serialization = 1;
2020-07-07 00:15:02 +00:00
INSERT INTO codecs SELECT number, number, toString(number) FROM numbers(1000);
2022-12-14 03:21:24 +00:00
SELECT sum(data_compressed_bytes), sum(data_uncompressed_bytes)
FROM system.parts
2020-07-07 00:15:02 +00:00
WHERE table = 'codecs' AND database = currentDatabase();
SELECT sum(id), sum(val), max(s) FROM codecs;
2020-09-08 16:28:49 +00:00
DETACH TABLE codecs;
ATTACH table codecs;
SELECT sum(id), sum(val), max(s) FROM codecs;
2020-07-07 00:15:02 +00:00
DROP TABLE codecs;
2022-12-14 03:21:24 +00:00
CREATE TABLE codecs (id UInt32 CODEC(NONE), val UInt32 CODEC(NONE), s String CODEC(NONE))
2020-07-07 00:15:02 +00:00
ENGINE = MergeTree ORDER BY id
2023-05-07 22:37:10 +00:00
SETTINGS min_rows_for_wide_part = 10000, ratio_of_defaults_for_sparse_serialization = 1;
2020-07-07 00:15:02 +00:00
INSERT INTO codecs SELECT number, number, toString(number) FROM numbers(1000);
2022-12-14 03:21:24 +00:00
SELECT sum(data_compressed_bytes), sum(data_uncompressed_bytes)
FROM system.parts
2020-07-07 00:15:02 +00:00
WHERE table = 'codecs' AND database = currentDatabase();
SELECT sum(id), sum(val), max(s) FROM codecs;
2020-09-08 16:28:49 +00:00
DETACH TABLE codecs;
ATTACH table codecs;
SELECT sum(id), sum(val), max(s) FROM codecs;
2020-07-07 00:15:02 +00:00
DROP TABLE codecs;
2022-12-14 03:21:24 +00:00
CREATE TABLE codecs (id UInt32, val UInt32 CODEC(Delta, ZSTD), s String CODEC(ZSTD))
2020-07-07 00:15:02 +00:00
ENGINE = MergeTree ORDER BY id
2023-05-07 22:37:10 +00:00
SETTINGS min_rows_for_wide_part = 10000, ratio_of_defaults_for_sparse_serialization = 1;
2020-07-07 00:15:02 +00:00
INSERT INTO codecs SELECT number, number, toString(number) FROM numbers(1000);
2022-12-14 03:21:24 +00:00
SELECT sum(data_compressed_bytes), sum(data_uncompressed_bytes)
FROM system.parts
2020-07-07 00:15:02 +00:00
WHERE table = 'codecs' AND database = currentDatabase();
SELECT sum(id), sum(val), max(s) FROM codecs;
2020-09-08 16:28:49 +00:00
DETACH TABLE codecs;
ATTACH table codecs;
SELECT sum(id), sum(val), max(s) FROM codecs;
2020-07-07 00:15:02 +00:00
DROP TABLE codecs;