开发者

Using a combination of InnoDB and MyIsam tables

开发者 https://www.devze.com 2022-12-14 23:49 出处:网络
I have 2 tables in which I want more robustness and fortunately don\'t require frequent rapid fulls of data and examination.

I have 2 tables in which I want more robustness and fortunately don't require frequent rapid fulls of data and examination. All other tables would inevitably be MyISAM.

Can I safely use both (I've read a handful of discouragements from this) without fearing bugs or data getting affected by differences between engi开发者_运维问答nes?


You CAN but this introduces a number of disadvantages:

  • Your server tuning will now necessarily be a compromise - you cannot use all the memory for either MyISAM OR InnoDB (NB: This does not apply if they are on different servers)
  • Replication fails in a number of edge-cases, because if you have a failed transaction which contained changes to some MyISAM tables, it can neither correctly commit it nor roll it back
  • You still can't back up your server using MVCC, because you'd still not get a consistent snapshot of MyISAM tables

So basically, I'd encourage you to switch wholly to InnoDB. Then you can pretty much forget about MyISAM and not devote resources to it, and get the full benefits of using InnoDB. Anyone who thinks MyISAM is faster is either not tuning InnoDB correctly, or has such small data that who cares.

MyISAM does faster table scans, but if you're doing those on large tables, you have bigger problems.


Yes, you can.

Note that only InnoDB tables support transactions and FOREIGN KEY relationships.

0

精彩评论

暂无评论...
验证码 换一张
取 消