mysql covering index

covering index 是在innodb 1.0以後的版本實現的,這個索引的原理是查詢的數據不需要回表查詢數據,只需要在索引中就能找到需要的數據。

下面是mysql文檔的解釋:

covering index

An index that includes all the columns retrieved by a query. Instead of using the index values as pointers to find the full table rows, the query returns values from the index structure, saving disk I/O. InnoDB can apply this optimization technique to more indexes than MyISAM can, because InnoDB secondary indexes also include the primary key columns. InnoDB cannot apply this technique for queries against tables modified by a transaction, until that transaction ends.

Any column index or composite index could act as a covering index, given the right query. Design your indexes and queries to take advantage of this optimization technique wherever possible.



大體意思是:索引包含查詢的所有列,不需要查詢所有列,只需要從索引中就可以取回需要的數據,節省了i/o,。。。

第二段說的是合理設計索引,讓查詢通過convering index查詢會成爲可能


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章