Home > Database > Mysql Tutorial > body text

What is the specification of mysql index?

王林
Release: 2023-05-31 17:43:06
forward
1975 people have browsed it

1. It is recommended to control the number of indexes in a single table within 5.

2. It is not recommended that the number of combined index fields exceed 5.

3. Join prohibits more than three tables.

The data types of fields that need to be joined must be absolutely consistent.

4. Left blur or full blur is strictly prohibited. If necessary, use a search engine to resolve it.

5. If there is an orderby scenario, please pay attention to the orderliness of the index.

Example

1)consts 单表中最多只有一个匹配行(主键或者唯一索引),在优化阶段即可读取到数据。
2)ref 指的是使用普通的索引(normal index)。
3)range 对索引进行范围检索。
反例:explain 表的结果,type=index,索引物理文件全扫描,速度非常慢,这个 index 级别比较 range 还低,与全表扫描是小巫见大巫。
Copy after login

The above is the detailed content of What is the specification of mysql index?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
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