2014-05-07 11:44:14 +00:00
|
|
|
CREATE DATABASE IF NOT EXISTS test;
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS empty_summing;
|
|
|
|
CREATE TABLE empty_summing (d Date, k UInt64, v Int8) ENGINE=SummingMergeTree(d, k, 8192);
|
2014-05-07 11:44:14 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO empty_summing VALUES ('2015-01-01', 1, 10);
|
|
|
|
INSERT INTO empty_summing VALUES ('2015-01-01', 1, -10);
|
2014-05-07 11:44:14 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
OPTIMIZE TABLE empty_summing;
|
|
|
|
SELECT * FROM empty_summing;
|
2014-05-07 11:44:14 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO empty_summing VALUES ('2015-01-01', 1, 4),('2015-01-01', 2, -9),('2015-01-01', 3, -14);
|
|
|
|
INSERT INTO empty_summing VALUES ('2015-01-01', 1, -2),('2015-01-01', 1, -2),('2015-01-01', 3, 14);
|
|
|
|
INSERT INTO empty_summing VALUES ('2015-01-01', 1, 0),('2015-01-01', 3, 0);
|
2014-05-07 11:44:14 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
OPTIMIZE TABLE empty_summing;
|
|
|
|
SELECT * FROM empty_summing;
|
2014-05-07 11:44:14 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE empty_summing;
|