I. Type of index
In MySQL, the index is implemented at the storage engine layer, not the server layer, so there is no uniform standard.
MySQL supports the following types of indexes:
1, B-tree index (also includes B+tree index, collectively referred to as the B-tree index, but the data structure is different, the characteristics are the same)
Using the B-tree data structure to store the information, there is actually a storage engine using B+tree. About Btree, b-tree, B+tree difference please see the attachment of this blog.
InnoDB is the B+tree index used.
B-tree usually means that all values are stored sequentially, and each leaf page to the same distance.
B-tree is stored sequentially on indexed columns, so it is well suited to look for range data.
The B-tree index is suitable for a full key value, a key value range, or a key prefix lookup, where the key prefix lookup is suitable only for lookups based on the leftmost prefix.
An example is provided:
The data are as follows:
A, full value matching
Matching all columns in an index must be in the order defined by the index, such as: