Merge pull request #9038 from CurtizJ/fix-range-reader

Add test for #8914
This commit is contained in:
Anton Popov 2020-02-07 03:47:51 +03:00 committed by GitHub
commit 9dc7577d15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,16 @@
0 1
0 1
1 1
2 1
3 1
4 1
50 1
51 1
52 1
53 1
54 1
100 1
101 1
102 1
103 1
104 1

View File

@ -0,0 +1,10 @@
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;
-- some magic to satisfy conditions to run optimizations in MergeTreeRangeReader
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;