2020-02-06 18:57:18 +00:00
|
|
|
drop table if exists t50;
|
|
|
|
|
|
|
|
create table t50 (a Int, b Int, s String) engine = MergeTree order by a settings index_granularity = 50, index_granularity_bytes=1000;
|
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
-- some magic to satisfy conditions to run optimizations in MergeTreeRangeReader
|
2020-02-06 18:57:18 +00:00
|
|
|
insert into t50 select 0, 1, repeat('a', 10000);
|
|
|
|
insert into t50 select number, multiIf(number < 5, 1, number < 50, 0, number < 55, 1, number < 100, 0, number < 105, 1, 0), '' from numbers(150);
|
|
|
|
optimize table t50 final;
|
|
|
|
|
|
|
|
select a, b from t50 prewhere b = 1 order by a;
|
2020-02-11 18:05:08 +00:00
|
|
|
|
|
|
|
drop table t50;
|