2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS src;
|
|
|
|
DROP TABLE IF EXISTS mv1;
|
|
|
|
DROP TABLE IF EXISTS mv2;
|
2018-10-03 02:06:04 +00:00
|
|
|
|
|
|
|
CREATE TABLE src (x UInt8) ENGINE = Null;
|
|
|
|
CREATE MATERIALIZED VIEW mv1 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 0;
|
|
|
|
CREATE MATERIALIZED VIEW mv2 ENGINE = Memory AS SELECT x FROM src WHERE x % 2 = 1;
|
|
|
|
|
|
|
|
SET parallel_view_processing = 1;
|
|
|
|
INSERT INTO src VALUES (1), (2);
|
|
|
|
|
|
|
|
SET parallel_view_processing = 0;
|
|
|
|
INSERT INTO src VALUES (3), (4);
|
|
|
|
|
|
|
|
SELECT * FROM mv1 ORDER BY x;
|
|
|
|
SELECT * FROM mv2 ORDER BY x;
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE mv1;
|
|
|
|
DROP TABLE mv2;
|
|
|
|
DROP TABLE src;
|