ClickHouse/tests/queries/0_stateless/01605_skip_idx_compact_parts.sql

19 lines
734 B
MySQL
Raw Normal View History

2020-12-18 13:41:47 +00:00
DROP TABLE IF EXISTS skip_idx_comp_parts;
CREATE TABLE skip_idx_comp_parts (a Int, b Int, index b_idx b TYPE minmax GRANULARITY 4)
ENGINE = MergeTree ORDER BY a
SETTINGS index_granularity=256, merge_max_block_size=100;
2021-03-07 14:46:13 +00:00
SYSTEM STOP MERGES skip_idx_comp_parts;
2020-12-18 13:41:47 +00:00
INSERT INTO skip_idx_comp_parts SELECT number, number FROM numbers(200);
INSERT INTO skip_idx_comp_parts SELECT number, number FROM numbers(200);
INSERT INTO skip_idx_comp_parts SELECT number, number FROM numbers(200);
INSERT INTO skip_idx_comp_parts SELECT number, number FROM numbers(200);
2021-03-07 14:46:13 +00:00
SYSTEM START MERGES skip_idx_comp_parts;
2020-12-18 13:41:47 +00:00
OPTIMIZE TABLE skip_idx_comp_parts FINAL;
SELECT count() FROM skip_idx_comp_parts WHERE b > 100;
DROP TABLE skip_idx_comp_parts;