MySQLexplain of possible_keys, key introduction and key_len

possible_keys:
displays the index in this table may use one or more.
Queries related to the field if there is an index, the index will be listed, but not necessarily the actual query

key:
the index of actual use. If NULL, then do not use the index

If the query uses the coverage index, the index and query selet field overlap occurs only in the key list.
Cover index: the number of fields and the order of the fields indexed exactly match queries
Here Insert Picture Description
The key_len:
number of bytes used in the index, said length of the index may be used in the query is calculated by the column. Without loss of accuracy, a length as short as possible
key_len maximum possible length values of the index fields displayed, not the actual length , i.e. calculated on the basis key_len table definition is not retrieved by the inner
Here Insert Picture Description

Published 217 original articles · won 125 Like · views 10000 +

Guess you like

Origin blog.csdn.net/qq_39885372/article/details/104177154