[英]MyISAM and InnoDB tables in one database
I have a database with about 30 tables and 5 tables of them is write-intensive. 我有一个包含大约30个表的数据库,其中5个表是写密集型的。
I'm considering 我在考虑
Convert 5 write-intensive tables to use InnoDB engine and keep the rest on MyISAM engine 转换5个写密集型表以使用InnoDB引擎,并将其余部分保留在MyISAM引擎上
Convert all tables to use InnoDB engine. 转换所有表以使用InnoDB引擎。
I wonder which approach is better? 我想知道哪种方法更好?
To be more specific 更加具体
The reason I want to keep some table on MyISAM engine is some of them has around 1,000,000 rows. 我想在MyISAM引擎上保留一些表的原因是它们中的一些有大约1,000,000行。 I'm not sure how slower it will be for queries like "SELECT COUNT(*)" on these tables after converted to InnoDB.
我不确定转换为InnoDB后这些表上的“SELECT COUNT(*)”查询会有多慢。
I haven't done a test. 我没有做过测试。 I prefer getting some advices from any of you before start the switch.
在开始转换之前,我更喜欢从你们这里得到一些建议。
These days, I always default to using InnoDB, especially on the write-intensive tables you mention where MyISAM suffers from full table locking. 这些天,我总是默认使用InnoDB,特别是在你提到的写密集表中,MyISAM遭受全表锁定。 Here's a to-the-point comparison.
这是一个比较点。
Reasons to use MyISAM: 使用MyISAM的原因:
Reasons to use InnoDB: 使用InnoDB的原因:
The above was taken from this site , which no longer seems to be working. 以上内容取自该网站 ,似乎不再有效。
pros and cons for each. 每个人的利弊。
for (1) pros: less disk space usage, myisam much faster for read-heavy access patterns 对于(1)专业人士:更少的磁盘空间使用,myisam对于读取繁重的访问模式来说要快得多
cons: memory must be shared between the innodb buffers and myisam key buffers. 缺点:必须在innodb缓冲区和myisam密钥缓冲区之间共享内存。 innodb tables are about 4x bigger than their myisam counterparts.
innodb表比他们的myisam表大约4倍。 programmatic code must be adapted for deadlock handling.
程序代码必须适应死锁处理。
just remember innodb will also lock if you're changing an indexed column or primary key. 请记住,如果您要更改索引列或主键,innodb也会锁定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.