2018-10-19 21:03:45 +00:00
|
|
|
SET compile_expressions = 1;
|
2019-02-11 14:36:54 +00:00
|
|
|
SET min_count_to_compile_expression = 1;
|
2018-10-19 21:03:45 +00:00
|
|
|
SET optimize_move_to_prewhere = 0;
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS dt;
|
|
|
|
DROP TABLE IF EXISTS testx;
|
2018-10-19 21:03:45 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE dt(tkey Int32) ENGINE = MergeTree order by tuple();
|
|
|
|
INSERT INTO dt VALUES (300000);
|
|
|
|
CREATE TABLE testx(t Int32, a UInt8) ENGINE = MergeTree ORDER BY tuple();
|
|
|
|
INSERT INTO testx VALUES (100000, 0);
|
2018-10-19 21:03:45 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT COUNT(*) FROM testx WHERE NOT a AND t < (SELECT tkey FROM dt);
|
2018-10-19 21:03:45 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE dt;
|
|
|
|
CREATE TABLE dt(tkey Int32) ENGINE = MergeTree order by tuple();
|
|
|
|
INSERT INTO dt VALUES (0);
|
2018-10-19 21:03:45 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT COUNT(*) FROM testx WHERE NOT a AND t < (SELECT tkey FROM dt);
|
2018-10-19 21:03:45 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS dt;
|
|
|
|
DROP TABLE IF EXISTS testx;
|