2021-06-30 10:39:58 +00:00
|
|
|
drop table if exists t;
|
|
|
|
|
|
|
|
create table t (i int, j int, k int, projection p (select * order by j)) engine MergeTree order by i settings index_granularity = 1;
|
|
|
|
|
|
|
|
insert into t select number, number, number from numbers(10);
|
|
|
|
|
2023-05-10 01:35:13 +00:00
|
|
|
set optimize_use_projections = 1, max_rows_to_read = 3;
|
2021-06-30 10:39:58 +00:00
|
|
|
|
|
|
|
select * from t where i < 5 and j in (1, 2);
|
|
|
|
|
|
|
|
drop table t;
|
2022-11-04 09:26:44 +00:00
|
|
|
|
|
|
|
drop table if exists test;
|
|
|
|
|
|
|
|
create table test (name String, time Int64) engine MergeTree order by time;
|
|
|
|
|
|
|
|
insert into test values ('hello world', 1662336000241);
|
|
|
|
|
|
|
|
select count() from (select fromUnixTimestamp64Milli(time, 'UTC') time_fmt, name from test where time_fmt > '2022-09-05 00:00:00');
|
|
|
|
|
|
|
|
drop table test;
|