ClickHouse/tests/queries/0_stateless/01625_constraints_index_append.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
733 B
MySQL
Raw Normal View History

2021-04-28 17:35:51 +00:00
SET convert_query_to_cnf = 1;
SET optimize_using_constraints = 1;
SET optimize_move_to_prewhere = 1;
2021-05-04 19:18:37 +00:00
SET optimize_substitute_columns = 1;
SET optimize_append_index = 1;
2021-04-28 17:35:51 +00:00
2021-05-04 19:31:32 +00:00
DROP TABLE IF EXISTS index_append_test_test;
2021-04-28 17:35:51 +00:00
2021-05-04 19:31:32 +00:00
CREATE TABLE index_append_test_test (i Int64, a UInt32, b UInt64, CONSTRAINT c1 ASSUME i <= 2 * b AND i + 40 > a) ENGINE = MergeTree() ORDER BY i;
INSERT INTO index_append_test_test VALUES (1, 10, 1), (2, 20, 2);
2021-04-28 17:35:51 +00:00
2021-05-04 19:31:32 +00:00
EXPLAIN SYNTAX SELECT i FROM index_append_test_test WHERE a = 0;
EXPLAIN SYNTAX SELECT i FROM index_append_test_test WHERE a < 0;
EXPLAIN SYNTAX SELECT i FROM index_append_test_test WHERE a >= 0;
EXPLAIN SYNTAX SELECT i FROM index_append_test_test WHERE 2 * b < 100;
2021-04-28 17:35:51 +00:00
2021-05-04 19:31:32 +00:00
DROP TABLE index_append_test_test;