1、查问语句中所需的列在索引中,这样查问后果就能够在索引的数据结构中找到。
2、因为笼罩索引能够缩小树木的搜寻次数,显著进步查问性能,因而应用笼罩索引是一种罕用的性能优化办法。
实例
+----+-------------+------------+------+-----------------------+--------------+---------+-------+------+-------------+| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |+----+-------------+------------+------+-----------------------+--------------+---------+-------+------+-------------+| 1 | SIMPLE | user_group | ref | group_id,group_id_uid | group_id_uid | 4 | const | 5378 | Using index |+----+-------------+------------+------+-----------------------+--------------+---------+-------+------+-------------+
以上就是mysql笼罩索引的了解,心愿对大家有所帮忙。更多mysql学习指路:Mysql