
MariaDB [test]> create table t10 (a int, b int, filler varchar(100), index(a), index(b)) ;
MariaDB [test]> insert into t10 select seq, seq, seq from seq_1_to_10000;
MariaDB [test]> set optimizer_switch='rowid_filter=off';

MariaDB [test]> explain select * from t10 where a < 100 ;
+------+-------------+-------+-------+---------------+------+---------+------+------+-----------------------+
| id   | select_type | table | type  | possible_keys | key  | key_len | ref  | rows | Extra                 |
+------+-------------+-------+-------+---------------+------+---------+------+------+-----------------------+
|    1 | SIMPLE      | t10   | range | a             | a    | 5       | NULL | 99   | Using index condition |
+------+-------------+-------+-------+---------------+------+---------+------+------+-----------------------+
1 row in set (0.002 sec)

MariaDB [test]> explain select /*+ MRR(t10 a ) */ * from t10 where a < 100;
+------+-------------+-------+-------+---------------+------+---------+------+------+-------------------------------------------+
| id   | select_type | table | type  | possible_keys | key  | key_len | ref  | rows | Extra                                     |
+------+-------------+-------+-------+---------------+------+---------+------+------+-------------------------------------------+
|    1 | SIMPLE      | t10   | range | a             | a    | 5       | NULL | 99   | Using index condition; Rowid-ordered scan |
+------+-------------+-------+-------+---------------+------+---------+------+------+-------------------------------------------+
1 row in set (0.001 sec)

MariaDB [test]> explain select /*+ MRR(t10 a ) */ * from t10 where a < 5000;
+------+-------------+-------+------+---------------+------+---------+------+-------+-------------+
| id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows  | Extra       |
+------+-------------+-------+------+---------------+------+---------+------+-------+-------------+
|    1 | SIMPLE      | t10   | ALL  | a             | NULL | NULL    | NULL | 10023 | Using where |
+------+-------------+-------+------+---------------+------+---------+------+-------+-------------+
1 row in set (0.002 sec)

MariaDB [test]> explain select /*+ MRR(t10 a ) */ * from t10 where a < 100 and b < 50;
+------+-------------+-------+-------+---------------+------+---------+------+------+------------------------------------+
| id   | select_type | table | type  | possible_keys | key  | key_len | ref  | rows | Extra                              |
+------+-------------+-------+-------+---------------+------+---------+------+------+------------------------------------+
|    1 | SIMPLE      | t10   | range | a,b           | b    | 5       | NULL | 49   | Using index condition; Using where |
+------+-------------+-------+-------+---------------+------+---------+------+------+------------------------------------+
1 row in set (0.002 sec)

