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

WBOY
Release: 2016-08-08 09:32:01
Original
1302 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template