Files
homework/mnoskov/clickhouse/Практика clickhouse/3. Индексы и сжатие/3. Сжатие/practice_compression.sql
T
2026-05-19 09:45:42 +03:00

27 lines
603 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- Задание 1
CREATE TABLE mnoskov.logs
ON CLUSTER clickhouse_cluster
(
id UInt64,
level String,
message String CODEC(ZSTD(3)),
created_at DateTime CODEC(Delta, ZSTD)
)
ENGINE=ReplicatedMergeTree(
'/clickhouse/tables/{shard}/mnoskov/logs',
'{replica}'
)
ORDER BY created_at;
SELECT
column,
compression_codec
FROM system.columns
WHERE table = 'logs';
-- если делать с codec_expression, то ошибка вылазит мол такой колонки нет
-- Выглядит вот так:
-- id
-- level
-- message CODEC(ZSTD(3))
-- created_at CODEC(Delta(4), ZSTD(1))