MariaDB [test]> SET OPTIMIZER_SWITCH="index_merge_sort_union=ON";
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> explain SELECT * FROM t1 WHERE a > 5;
|
+------+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
|
| 1 | SIMPLE | t1 | range | a | a | 5 | NULL | 4 | Using where; Using index |
|
+------+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> SET OPTIMIZER_SWITCH="index_merge_sort_union=OFF";
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> explain SELECT * FROM t1 WHERE a > 5;
|
+------+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
|
| 1 | SIMPLE | t1 | index | a | a | 5 | NULL | 10 | Using where; Using index |
|
+------+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
|
1 row in set (0.00 sec)
|