Home > Database > Mysql Tutorial > body text

Mysql-index coverage

黄舟
Release: 2017-01-20 17:09:13
Original
1414 people have browsed it

The index is a data structure that is convenient for searching, and it is also cached in memory. It is very fast to use the index to find the physical row address, but it will be slower to extract the required field values ​​​​from the physical row (return). .

Querying the index is fast, but using the index to find all the data you want from the physical disk (return) is slow.

Mysql-index coverage


As shown above, the index is usename. If the selected field has id, username, age... then you have to go to the physical row to extract the data ;If you select id, it will be stored in the index, so you don’t need to look for it and you will be satisfied.

Summary: The content of the query happens to be in the index, and there is no need to go back and search. This situation is called index coverage


Mysql-index coverage

If the above Using appears The index part means that a covering index is used.

The innodb engine goes one step further on the covering index:

The innodb engine all stores the primary key ID, transaction ID, rollback pointer, non-primary key ID,

his query Even non-primary key IDs can also be overwritten to obtain the primary key ID.

The above is the content covered by Mysql-index. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
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