简体   繁体   English

MySQL:innoDB和MyISAM之间的索引差异

[英]MySQL: index diffrences between innoDB and MyISAM

innoDB和MyISAM中的索引之间的主要区别是什么?

InnoDB is a fully ACID compliant database with support for transactions, MVCC , replication, and like a modern filesystem keeps a journal of changes so that in case of a sudden crash or hardware malfunction it can recover to the last known-good state of the database. InnoDB是完全兼容ACID的数据库,支持事务, MVCC ,复制,并且像现代文件系统一样,保留更改日志,以便在突然崩溃或硬件故障的情况下,它可以恢复到数据库的最后一个正常状态。

MyISAM is the original database engine for MySQL with a focus on speed over reliability. MyISAM是MySQL的原始数据库引擎,专注于速度而不是可靠性。 It lacks transaction support and doesn't use a journal so if the database crashes it can be easily corrupted. 它缺少事务支持,并且不使用日志,因此如果数据库崩溃,则很容易损坏它。 It's a lot like the Linux ext2 filesystem in this regard. 在这方面,它很像Linux ext2文件系统。 This is a product of the era where a high-end computer might have all of 256MB of memory and a 9GB hard disk was considered large. 这是一个时代的产品,其中高端计算机可能拥有全部256MB的内存,而9GB的硬盘被认为是很大的。

While on antiquated hardware MyISAM was a necessity, on modern hardware InnoDB actually performs better. 虽然在陈旧的硬件上必须使用MyISAM,但在现代硬件上,InnoDB的性能实际上更好。 It's been continuously improved since its introduction and has been aggressively optimized. 自推出以来,它一直在不断改进,并进行了积极的优化。 Each point release of MySQL continues to push performance on InnoDB while MyISAM remains largely untouched, left in there purely for legacy concerns. MySQL的每个点发行版都继续提高InnoDB的性能,而MyISAM基本上保持不变,纯粹出于遗留问题而留在那里。

So unless you have a very good reason you should be using InnoDB for all new applications. 因此,除非您有充分的理由,否则应将InnoDB用于所有新应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM