Home  >  Article  >  Backend Development  >  Mysql database optimization series (5) ------Interview questions on index optimization strategies

Mysql database optimization series (5) ------Interview questions on index optimization strategies

WBOY
WBOYOriginal
2016-08-08 09:32:011260browse

Experiment:

Type:range The range index is used here

Key_len:12/3=4Column

The indexes c1, c2, c3, c4 are used. Analysis : Because order by c3 is ordered, c3 and c4 also use the index

The above picture uses c1, c2, c3, order by order, you can use the index.

The above picture only uses index c1, because order by c3, the order of c2 is different from the index order

The above picture c1, c2, c3

The above picture c1, c2, c3 because When sorting, c2 is a constant

Only c1 is used in the above picture

To count the average price by column (group by)

Generally speaking, grouping must first be sorted by the grouping field, Arrangement, using temporary table sorting.



The above introduces the Mysql database optimization series (5)------Interview questions on index optimization strategies, including relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Bubble sort-phpNext article:Bubble sort-php