The underlying reasons for not taking the combinatorial index

there is a composite index A where B condition Backx does not take the index why why it has something to do with the order of its fields can you answer from the underlying b-tree principle of the index?

Sql
Mar.02,2021

for example, you can understand that an index is the pinyin directory in a dictionary. If you want to look up a word "medium", then we will know that the first letter is z, and go directly to the z section to check the specific number of pages of the text.
if we don't know the initial consonant of "Zhong", but only know that the vowel is "ong", then the pinyin directory cannot be queried quickly.

corresponds to mysql, it can be understood that field An is an initial consonant and B is a vowel. To form a combined index is a desperate catalogue table. Querying according to the contents of field B is the same principle as looking up a dictionary's pinyin catalogue with vowels.


combine indexes, because your field is ab, then two indexes an and ab will be generated. Don't think about the
an index. The
ab index cannot walk through the index because you do not specify the a field.

Menu