MRR,全稱「Multi-Range Read Optimization」。
簡單說:MRR 通過把「隨機磁盤讀」,轉化為「順序磁盤讀」,從而提高瞭索引查詢的性能。
至於:
咱們開始吧。
執行一個范圍查詢:
mysql > explain select * from stu where age between 10 and 20;
+----+-------------+-------+-------+------+---------+------+------+-----------------------+
| id | select_type | table | type | key | key_len | ref | rows | Extra |
+----+-------------+-------+-------+----------------+------+------+-----------------------+
| 1 | SIMPLE | stu | range | age | 5 | NULL | 960 | Using index condition |
+----+-------------+-------+-------+----------------+------+------+-----------------------+