简体   繁体   English

我应该将我的数据库从MyISAM更改为InnoDB吗? (AWS通知)

[英]Should I change my DB from MyISAM to InnoDB? (AWS notification)

I am developing a browser app that connects to several MySQL-databases through php-sites. 我正在开发一个浏览器应用程序,通过php站点连接到几个MySQL数据库。 These databases are set on a single AWS RDS instance. 这些数据库在单个AWS RDS实例上设置。 When I set up these databases I was not very well informed about the different db engines. 当我设置这些数据库时,我不太了解不同的数据库引擎。 After reading about the different types I decided to use InnoDB for low IOPS demands and MyISAM for high IOPS demands as I read it was faster in certain tasks. 在阅读了不同的类型之后,我决定使用InnoDB来满足低IOPS需求和MyISAM以满足高IOPS需求,因为我读到它在某些任务中更快。

Amazon Web Services tells me that: 亚马逊网络服务告诉我:

DB Instance test-1 contains MyISAM tables that have not been migrated to InnoDB. 数据库实例test-1包含尚未迁移到InnoDB的MyISAM表。 These tables can impact your ability to perform point-in-time restores. 这些表可能会影响您执行时间点还原的能力。 Consider converting these tables to InnoDB. 考虑将这些表转换为InnoDB。 Please refer to http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.BackingUpAndRestoringAmazonRDSInstances.html#Overview.BackupDeviceRestrictions 请参阅http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.BackingUpAndRestoringAmazonRDSInstances.html#Overview.BackupDeviceRestrictions

Should I recreate the MyISAM db using InnoDB? 我应该使用InnoDB重新创建MyISAM数据库吗?

The trope about MyISAM being faster than InnoDB is a holdover from code that was current in the mid-2000's. 关于MyISAM的速度比InnoDB更快,这是2000年代中期代码的延续。

MyISAM is not faster than InnoDB anymore, for most types of queries. 对于大多数类型的查询,MyISAM 不再比InnoDB快。 Look at the benchmarks in this blog from 2007: https://www.percona.com/blog/2007/01/08/innodb-vs-myisam-vs-falcon-benchmarks-part-1/ 请查看2007年此博客中的基准: https//www.percona.com/blog/2007/01/08/innodb-vs-myisam-vs-falcon-benchmarks-part-1/

InnoDB has just gotten better, faster, and more reliable since then. 从那以后,InnoDB刚刚变得更好,更快,更可靠。 MyISAM is not being developed. MyISAM尚未开发。

Update: In MySQL 8.0, even the system tables have been converted to InnoDB. 更新:在MySQL 8.0中,甚至系统表都已转换为InnoDB。 There is clearly an intention to phase out MyISAM. 显然有意逐步淘汰MyISAM。 I expect that it will be deprecated and then removed in future versions of MySQL (but I can't say how many years from now that will be). 我希望它会被弃用,然后在MySQL的未来版本中删除(但我不能说从现在起多少年)。

There were a couple of edge cases where MyISAM might be faster, like table-scans. 有几个边缘情况,MyISAM可能更快,如表扫描。 But you really shouldn't be optimizing your database for table-scans. 但是你真的不应该为表扫描优化数据库。 You should be creating the right indexes to avoid table-scans. 您应该创建正确的索引以避免表扫描。

Update Feb 2018: MyISAM just suffered an additional 40% performance hit from the recent fix for the Meltdown CPU bug, and this affects table-scans. 2018年2月更新: MyISAM刚刚遭受了最近针对Meltdown CPU错误修复的40%的性能损失,这会影响表扫描。 Assuming you are responsible and patch your systems to fix the Meltdown vulnerability, MyISAM is now a performance liability. 假设您负责并修补系统以修复Meltdown漏洞,MyISAM现在是性能责任。 See current tests of MyISAM performance with the patch: https://mariadb.org/myisam-table-scan-performance-kpti/ 请参阅补丁的当前MyISAM性能测试: https//mariadb.org/myisam-table-scan-performance-kpti/

But what trumps that is the fact that InnoDB supports ACID behavior, and MyISAM doesn't support any of the four qualities of ACID. 但是,胜利的是InnoDB支持ACID行为的事实,而MyISAM不支持ACID的四种特性中的任何一种。 See my answer to MyISAM versus InnoDB 请参阅我对MyISAM与InnoDB的回答

Failing to support ACID isn't just an academic point. 不支持ACID不仅仅是一个学术观点。 It translates into things like table-locks during updates, and global locks during backups. 它转换为更新期间的表锁和备份期间的全局锁。

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

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