Sargable UPPER
UPPER(key_col) = expr
UPPER(key_col) IN (constant-list)Example
CREATE TABLE t1 (
key1 VARCHAR(32) COLLATE utf8mb4_general_ci,
...
KEY(key1)
);EXPLAIN SELECT * FROM t1 WHERE UPPER(key1)='ABC'
+------+-------------+-------+------+---------------+------+---------+-------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------+------+---------------+------+---------+-------+------+--------------------------+
| 1 | SIMPLE | t1 | ref | key1 | key1 | 131 | const | 1 | Using where; Using index |
+------+-------------+-------+------+---------------+------+---------+-------+------+--------------------------+Controlling the Optimization
Optimizer Trace
References
Last updated
Was this helpful?

