Home > Database > Mysql Tutorial > body text

Mysql covering index high performance instance analysis

王林
Release: 2023-05-29 22:18:07
forward
1005 people have browsed it

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;
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!