2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS index;
|
2016-07-09 00:20:44 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE index
|
2016-07-09 00:20:44 +00:00
|
|
|
(
|
|
|
|
key Int32,
|
|
|
|
name String,
|
|
|
|
merge_date Date
|
|
|
|
) ENGINE = MergeTree(merge_date, key, 8192);
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
insert into index values (1,'1','2016-07-07');
|
|
|
|
insert into index values (-1,'-1','2016-07-07');
|
2016-07-09 00:20:44 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
select * from index where key = 1;
|
|
|
|
select * from index where key = -1;
|
|
|
|
OPTIMIZE TABLE index;
|
|
|
|
select * from index where key = 1;
|
|
|
|
select * from index where key = -1;
|
|
|
|
select * from index where key < -0.5;
|
2016-07-09 00:20:44 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE index;
|