Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a combination of InnoDB and MyIsam tables

Tags:

mysql

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 engines?

like image 292
Gal Avatar asked Dec 24 '09 17:12

Gal


1 Answers

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.

like image 57
MarkR Avatar answered Oct 12 '22 12:10

MarkR