2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS mergetree;
|
|
|
|
CREATE TABLE mergetree (x UInt8, s String) ENGINE = MergeTree ORDER BY tuple();
|
2018-09-10 15:52:50 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO mergetree VALUES (1, 'Hello, world!');
|
|
|
|
SELECT * FROM mergetree;
|
2018-09-10 15:52:50 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
ALTER TABLE mergetree ADD COLUMN y UInt8 DEFAULT 0;
|
|
|
|
INSERT INTO mergetree VALUES (2, 'Goodbye.', 3);
|
|
|
|
SELECT * FROM mergetree ORDER BY x;
|
2018-09-10 15:52:50 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT s FROM mergetree PREWHERE x AND y ORDER BY s;
|
|
|
|
SELECT s, y FROM mergetree PREWHERE x AND y ORDER BY s;
|
2018-09-10 15:52:50 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE mergetree;
|