blob: aa7a32dbd3ade38b94f1b80e9119f85bb12a4f58 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
DROP TABLE IF EXISTS integers;
SET optimizer_switch='mrr_cost_based=off';
CREATE TABLE integers (
id INT PRIMARY KEY AUTO_INCREMENT,
value INT,
KEY (value)
) COMMENT='engine "InnoDB"';
INSERT INTO integers (value) VALUES (0), (1), (2), (3);
EXPLAIN SELECT * FROM integers
WHERE value IN (0, 2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE integers range value value 5 NULL 2 Using where; Using MRR
SELECT * FROM integers
WHERE value IN (0, 2);
id value
1 0
3 2
DROP TABLE integers;
|