2024-03-25 02:31:24 +00:00
|
|
|
SET optimize_trivial_insert_select = 1;
|
|
|
|
|
2021-09-16 12:52:35 +00:00
|
|
|
DROP TABLE IF EXISTS t_sparse_distinct;
|
|
|
|
|
|
|
|
CREATE TABLE t_sparse_distinct (id UInt32, v UInt64)
|
|
|
|
ENGINE = MergeTree
|
|
|
|
ORDER BY id
|
|
|
|
SETTINGS ratio_of_defaults_for_sparse_serialization = 0.9;
|
|
|
|
|
|
|
|
SYSTEM STOP MERGES t_sparse_distinct;
|
|
|
|
|
2023-02-16 21:53:53 +00:00
|
|
|
INSERT INTO t_sparse_distinct SELECT number, number % 6 FROM numbers(100000);
|
2021-09-16 12:52:35 +00:00
|
|
|
INSERT INTO t_sparse_distinct SELECT number, number % 100 = 0 FROM numbers(100000);
|
|
|
|
|
|
|
|
SELECT name, column, serialization_kind
|
|
|
|
FROM system.parts_columns
|
|
|
|
WHERE table = 't_sparse_distinct' AND database = currentDatabase() AND column = 'v'
|
|
|
|
ORDER BY name;
|
|
|
|
|
|
|
|
SELECT DISTINCT v FROM t_sparse_distinct ORDER BY v;
|
|
|
|
|
|
|
|
DROP TABLE t_sparse_distinct;
|