MYSQL database optimization

1. An overview of the index

在海量数据中进行查询某条记录的场景是经常发生的,那么如何提升查询性能,就根要查询的数据字段是否有索引有关系。如果字段加了索引,那么查询的性能就非常快

为数据库的某个字段创建索引,相当于为这个字段内容创建了一个目录,通过这个目录可以快速的实现数据的定位,也就是通过索引能够快速的找到某条数据所在的磁盘位置
Insert picture description here

Question now?

Index storage location

Classification of the index and how to create it

What kind of data structure is used for the index
1. The location of the index storage
windows is generally in the c:/programdata/mysql (hidden folder) folder,

InnoDB storage engine tables: store indexes and data in the same file. *.ibd

Table of MyISAM storage engine: Index and data are stored in two files separately. Index: .MYI; Data: .MYD

Index classification

Insert picture description here
Insert picture description here

![Insert description of picture here](https://img-blog.csdnimg.cn/20210602163813260.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZW4ubNFF_center_color_center=70FFmd2,

Insert picture description here


Insert picture description here


Insert picture description here
Insert picture description here
Insert picture description here


Insert picture description here


Insert picture description here


Insert picture description here
Insert picture description here


Insert picture description here


Insert picture description here


Insert picture description here
Insert picture description here


Insert picture description here
Insert picture description here


Insert picture description here