Introduction to MySQL table files
One database corresponds to one folder
One table corresponds to one or more files
Engine myisam, one table corresponds to three files
.frm stores the table structure
.myd stores the table data
.myi stores the index of the table data
Engine innodb, one table corresponds to a table structure file, all table data of innodb are saved together in the ibdata1 file. When the database scale increases, files such as ibdata2 and ibdata3 will be automatically created
.myd stores table data
Note: It is recommended to use the innodb engine
The difference between innodb engine and myisam engine:
Engine | Difference |
Myisam |
The query speed is fast, prone to fragmentation, and cannot constrain the number |
Innodb |
The query speed was not as fast as myisam query before, but now it has been accelerated. No fragmentation. Can constrain data |
The above is the detailed content of Sample analysis of MySQL table files. For more information, please follow other related articles on the PHP Chinese website!