This commit is contained in:
Anton Popov 2020-11-24 20:41:11 +03:00
parent ff36dee2ec
commit f2106f9683
2 changed files with 16 additions and 0 deletions

View File

@ -3,3 +3,11 @@ SELECT
y
FROM prewhere_move
PREWHERE x > 100
SELECT
x1,
x2,
x3,
x4
FROM prewhere_move
PREWHERE x1 > 100
WHERE (x1 > 100) AND ((x2 > 100) AND (x3 > 100) AND (x4 > 100))

View File

@ -5,3 +5,11 @@ INSERT INTO prewhere_move SELECT number, toString(number) FROM numbers(1000);
EXPLAIN SYNTAX SELECT * FROM prewhere_move WHERE x > 100;
DROP TABLE prewhere_move;
CREATE TABLE prewhere_move (x1 Int, x2 Int, x3 Int, x4 Int) ENGINE = MergeTree ORDER BY tuple();
INSERT INTO prewhere_move SELECT number, number, number, number FROM numbers(1000);
-- Not all conditions moved
EXPLAIN SYNTAX SELECT * FROM prewhere_move WHERE x1 > 100 AND x2 > 100 AND x3 > 100 AND x4 > 100;
DROP TABLE prewhere_move;