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

55 lines
1.6 KiB
MySQL
Raw Normal View History

2021-09-12 12:35:27 +00:00
-- Tags: no-parallel
2020-07-07 00:15:02 +00:00
DROP TABLE IF EXISTS codecs;
CREATE TABLE codecs (id UInt32, val UInt32, s String)
ENGINE = MergeTree ORDER BY id
SETTINGS min_rows_for_wide_part = 10000;
INSERT INTO codecs SELECT number, number, toString(number) FROM numbers(1000);
SELECT sum(data_compressed_bytes), sum(data_uncompressed_bytes)
FROM system.parts
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;
CREATE TABLE codecs (id UInt32 CODEC(NONE), val UInt32 CODEC(NONE), s String CODEC(NONE))
ENGINE = MergeTree ORDER BY id
SETTINGS min_rows_for_wide_part = 10000;
INSERT INTO codecs SELECT number, number, toString(number) FROM numbers(1000);
SELECT sum(data_compressed_bytes), sum(data_uncompressed_bytes)
FROM system.parts
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;
CREATE TABLE codecs (id UInt32, val UInt32 CODEC(Delta, ZSTD), s String CODEC(ZSTD))
ENGINE = MergeTree ORDER BY id
SETTINGS min_rows_for_wide_part = 10000;
INSERT INTO codecs SELECT number, number, toString(number) FROM numbers(1000);
SELECT sum(data_compressed_bytes), sum(data_uncompressed_bytes)
FROM system.parts
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;