mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-19 04:42:37 +00:00
9 lines
646 B
SQL
9 lines
646 B
SQL
create table a (k UInt64, v UInt64, index i (v) type set(100) granularity 2) engine MergeTree order by k settings index_granularity=8192, index_granularity_bytes=1000000000, min_index_granularity_bytes=0;
|
|
insert into a select number, intDiv(number, 4096) from numbers(1000000);
|
|
select sum(1+ignore(*)) from a where indexHint(v in (20, 40));
|
|
select sum(1+ignore(*)) from a where indexHint(v in (select 20 union all select 40 union all select 60));
|
|
|
|
SELECT 1 FROM a PREWHERE v IN (SELECT 1) WHERE v IN (SELECT 2);
|
|
|
|
select 1 from a where indexHint(indexHint(materialize(0)));
|
|
select sum(1+ignore(*)) from a where indexHint(indexHint(v in (20, 40))); |