Range Optimizer
Basic example
CREATE TABLE t1 (
key1 INT,
key2 VARCHAR(100),
...
INDEX(key1),
INDEX(key2)
);-- Turn on optimizer trace so we can see the ranges:
SET optimizer_trace=1;
EXPLAIN SELECT * FROM t1 WHERE key1<10 AND key2='foo';
SELECT * FROM information_schema.optimizer_trace\GRanges are non-overlapping
Ranges for multi-part indexes
Not all comparisons produce ranges
Combinatorial blow-ups
Last updated
Was this helpful?

