innodb and Myisam

Here's a dumb question- if you have two sites on one linode, each with it's own database, can you have one database as MyIsam and the other as InnodB?

7 Replies

Absolutely. You can even mix MyISAM and InnoDB in the same database. You do need to pay attention to the server configuration, though, if you're going to use both.

Also, don't randomly choose one. As a rule of thumb in modern installations (MySQL 5.0+) choose innodb and configure it properly by default. MyISAM has advantages in specific situations, but InnoDB is much better in most.

In many web articles you'll find the reverse, where people tell you to use MyISAM because it's faster. This used to be the case, but nowadays it tends to be outdated. InnoDB is the default choice for tables because of it's more controlled caching, almost equal (and often even better) performance and much better concurrency.

Many places, including Linode Library, say "disable InnoDB on a VPS unless you need its features, it'll greatly reduce MySQL memory usage."

http://library.linode.com/troubleshooti … y_settings">http://library.linode.com/troubleshooting/memory-networking#mysqllowmemory_settings

Is that too not true anymore?

Innodb does have a slightly larger memory footprint. The question is: are you after low memory footprint or the additional features InnoDB provides?

Personally, I have a separate Linode for mysql, 2 for web and 1 for monitoring and various other tasks. I don't mind the slightly larger footprint of InnoDB. Especially if you take into account that MyISAM relies on OS filesystem cachign for it's performance. Under Innodb, this is kept within the inndob buffers as far as I know.

Another general rule is that MyISAM is faster if you're just reading from the database most of the time (running SELECTS). Whereas Innodb is better if you're writing to the database often (INSERT, UPDATE). MyISAM locks the entire table when it writes, whereas Innodb only locks a row.

As with all general rules, take it with a grain of salt.

Drupal is moving from MyISAM to InnoDB as the default in version 7.

Also if memory servers MyISAM supports full text search and innodb doesn't which means if you want to use the MATCH syntax you need MyISAM (I use myisam for my wiki for that reason)

That is correct, MyISAM is the only engine that supports fulltext. Then again, for any serious use of FULLTEXT I recommend using Sphinx (http://sphinxsearch.com).

It is magnitudes faster with a very low footprint both on CPU and memory side. It is insanely easy to set up (took me 4 hours the other day, and that was my first time using it/setting it up after having heard many many stories about it), and opens the door to all kinds of trickery the simple fulltext solution of MyISAM does not have (soundex, synonyms, etc).

If you use the OurDelta builds of MySQL, the SphinxSE storage engine is included. That makes it even easier to convert your application to work with sphinx, usually then just requiring a simple rewrite of queries.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct