---- mysql index of the joint index

Key Concepts:

  1. For mysql, the one sql in a table regardless of its index contains the number, but there is one and only one.

  2. For multi-column index for (a, b, c) which corresponds to the index 3 (a), (a, b), (a, b, c) 3 index, and since the index mysql optimizer, which where after the condition statement is scrambled, such as (b, c, a) you can also use the index. If the condition a, c appear more, in order to better utilize the index it is preferable to modify (ac, b).

ICP concept:

  1. Index range make sure the start and end range of the index.

  2. Index Filter index filter.

  Table 3. Table Filter filtered.

icp after mysql5.6 proposed is more than the second step, the previous Index filter is placed on the data operations, now more than 5.6 after the second step, the efficiency has improved a lot.

 

[Formulas] optimize
 the full value of my favorite matches, the most left-prefix to follow;
 take the lead in Big Brother can not die, the middle brother can not be broken;
 less computationally index column, after the failure of the whole range;
 the LIKE percentage write rightmost, covering indexes do not write * ;
 there OR, affect the index value ranging from empty to note;
 VAR quotation marks can not be lost, SQL optimization has a knack.

 

 Reprinted with joint separate index index difference test  https://blog.csdn.net/Abysscarry/article/details/80792876

Guess you like

Origin www.cnblogs.com/berandwaddle/p/11281699.html