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!