Home >Database >Mysql Tutorial >What is mysql covering index

What is mysql covering index

王林
王林forward
2023-05-26 11:19:191496browse

1. The columns required in the query statement are in the index, so that the query results can be found in the data structure of the index.

2. Because covering indexes can reduce the number of tree searches and significantly improve query performance, using covering indexes is a common performance optimization method.

Example

+----+-------------+------------+------+-----------------------+--------------+---------+-------+------+-------------+
| 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 |
+----+-------------+------------+------+-----------------------+--------------+---------+-------+------+-------------+

The above is the detailed content of What is mysql covering index. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete