add query test: 02477_logical_expressions_optimizer_low_cardinality

This commit is contained in:
Wangyang Guo 2022-11-08 15:05:25 +08:00
parent 8001510c1d
commit a2b83d3592
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,6 @@
SELECT a
FROM t_logical_expressions_optimizer_low_cardinality
WHERE a IN (\'x\', \'y\')
SELECT a
FROM t_logical_expressions_optimizer_low_cardinality
WHERE (b = 0) OR (b = 1)

View File

@ -0,0 +1,10 @@
DROP TABLE IF EXISTS t_logical_expressions_optimizer_low_cardinality;
set optimize_min_equality_disjunction_chain_length=3;
CREATE TABLE t_logical_expressions_optimizer_low_cardinality (a LowCardinality(String), b UInt32) ENGINE = Memory;
-- LowCardinality case, ignore optimize_min_equality_disjunction_chain_length limit, optimzer applied
EXPLAIN SYNTAX SELECT a FROM t_logical_expressions_optimizer_low_cardinality WHERE a = 'x' OR a = 'y';
-- Non-LowCardinality case, optimizer not applied for short chains
EXPLAIN SYNTAX SELECT a FROM t_logical_expressions_optimizer_low_cardinality WHERE b = 0 OR b = 1;
DROP TABLE t_logical_expressions_optimizer_low_cardinality;