Main reference materials: JavaGuide Interview Assault Edition v4.0, MyISAM and InnoDB performance test comparison , "High-performance Mysql Third Edition" my notes
Comparison item | InnoDB | MyISAM |
---|---|---|
Supported locks | Table lock | Table lock |
Whether to support MVCC | Yes | no |
Whether to support affairs | Yes | no |
Whether to support foreign keys | Yes | no |
Safe recovery after a crash | something wrong | |
count(*) | Dedicated storage | |
Performance 1 | Fast in single process | |
index | The primary index is a clustered index, and the others are non-clustered indexes | Non-clustered index. See the figure below for details |
As far as performance is concerned, I think a passage from Zhihu makes sense: MyISAM's index and data are separated, and the index is compressed, the memory usage has increased a lot, and more indexes can be loaded, while Innodb The index and data are tightly bound, and no compression is used, which will cause Innodb to be larger than MyISAM. ↩︎