Home >Database >Mysql Tutorial >Mysql covering index high performance instance analysis

Mysql covering index high performance instance analysis

王林
王林forward
2023-05-29 22:18:071035browse

1. Reasons for high performance

The index is usually smaller than the record. Covering index queries only need to read the index, not the record.

Indices are stored in order according to the size of the value, which requires less I/0 than random access records.

Most data engines can cache indexes better. For example, MyISAM only caches indexes.

2. Example

The action column of the ijiangtao_local_db_mysql table contains the index. Use explain to analyze the following query statement. For index-covered query, the value of Extra in the analysis result is Using index, indicating that a covering index is used:

explain select `action` from ijiangtao_local_db_mysql.t_user_action_log;

The above is the detailed content of Mysql covering index high performance instance analysis. 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