Some personal understanding about index covering

In fact, the index is an index covering the trees to meet demand without having to look at the follow-up operations such as: Secondary index back to the table operation, the operation happens when we will be called to retrieve a covering index, the index covering all index tree are applicable.

 

Index covering examples:

For example, we now have a table table1 it as a: id

1.select * from table1 where id = 1

2.select id from table1 where id = 1

Sql statement above two very similar, but because of different search fields. 1 will result in the sql statement can not be used to index covering operation. This is a very good example embodied in the 2 sql statement will be displayed using index so is to use an index covering explain the extra column in explain the extra. 2 will be used to cover the reason is because when the search index in the index tree to find the appropriate data in the leaf nodes back to the table without the operation of other operations such as joint index, it is more efficient.

 

The joint index What little bit?

1. back to the table without having to operate, reduce random IO overhead when the second look

2. Reduce the number of data pages traversed, because the number of data pages occupied by the index tree leaf node is certainly less than the number of the original table.

 

Guess you like

Origin www.cnblogs.com/hxjz/p/12608318.html