mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-14 16:03:27 +00:00
* feat: add per-column COMPRESSION option for SST columns CREATE TABLE accepts COMPRESSION WITH (type = 'zstd', level = N, page_size = '<size>') on a column. The options are stored in the column metadata, carried through gRPC column options, shown by SHOW CREATE TABLE, and applied by the mito SST writer and bulk part encoder as parquet column properties. Unset fields keep the SST defaults. Nested types are rejected. A page size below the dictionary page limit also lowers the column's dictionary page limit: parquet sizes write batches by the dictionary budget and keeps that size after falling back to plain encoding, which would otherwise ignore the smaller data page limit. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: validate column compression options before persistence Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: reject compression overrides on metric logical tables Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
16 lines
495 B
SQL
16 lines
495 B
SQL
SELECT * FROM legacy_payload ORDER BY ts;
|
|
|
|
CREATE TABLE compressed_payload (
|
|
ts TIMESTAMP TIME INDEX,
|
|
payload STRING COMPRESSION WITH (level = 3, page_size = '64KiB')
|
|
);
|
|
INSERT INTO compressed_payload SELECT * FROM legacy_payload;
|
|
ADMIN FLUSH_TABLE('compressed_payload');
|
|
|
|
-- SQLNESS ARG restart=true
|
|
SHOW CREATE TABLE compressed_payload;
|
|
|
|
INSERT INTO compressed_payload VALUES (2, 'after restart');
|
|
ADMIN FLUSH_TABLE('compressed_payload');
|
|
SELECT * FROM compressed_payload ORDER BY ts;
|