mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
82f31e1abb
Avoid using count() in quota related tests count() can subject to many optimization techniques, which is unstable for testing quota usage.
36 lines
1.0 KiB
SQL
36 lines
1.0 KiB
SQL
-- { echo }
|
|
|
|
drop table if exists tbl;
|
|
|
|
create table tbl (p Int64, t Int64, f Float64) Engine=MergeTree partition by p order by t settings index_granularity=1;
|
|
|
|
insert into tbl select number / 4, number, 0 from numbers(16);
|
|
|
|
select * from tbl WHERE indexHint(t = 1) order by t;
|
|
|
|
select * from tbl WHERE indexHint(t in (select toInt64(number) + 2 from numbers(3))) order by t;
|
|
|
|
select * from tbl WHERE indexHint(p = 2) order by t;
|
|
|
|
select * from tbl WHERE indexHint(p in (select toInt64(number) - 2 from numbers(3))) order by t;
|
|
|
|
drop table tbl;
|
|
|
|
drop table if exists XXXX;
|
|
|
|
create table XXXX (t Int64, f Float64) Engine=MergeTree order by t settings index_granularity=128;
|
|
|
|
insert into XXXX select number*60, 0 from numbers(100000);
|
|
|
|
SELECT sum(t) FROM XXXX WHERE indexHint(t = 42);
|
|
|
|
drop table if exists XXXX;
|
|
|
|
create table XXXX (t Int64, f Float64) Engine=MergeTree order by t settings index_granularity=8192;
|
|
|
|
insert into XXXX select number*60, 0 from numbers(100000);
|
|
|
|
SELECT count() FROM XXXX WHERE indexHint(t = toDateTime(0));
|
|
|
|
drop table XXXX;
|