1

Does anyone know how much memory MyISAM and innoDB use? How does their memory usages compare when dealing with small tables vs. when dealing with bigger tables (up to 32 GB)?

I know innoDB is heavier than MyISAM, but just how much more?

Any help would be appreciated.

Thanks, jb

2
  • 1
    Whatever you decide, you do need to raise the defaults; they will almost certainly be too low for your hardware. MySQL's defaults are very conservative. Commented Apr 29, 2009 at 23:31
  • "I know innoDB is heavier than MyISAM"., heavier is a wrong word,. Commented Jun 3, 2011 at 12:52

1 Answer 1

7

You can't compare them like that. Or at least, you shouldn't. Each one uses the memory in a different way. This is especially true if you're tunning your DB's for performance.

MyISAM has specific buffers for indexes and it uses the OS disk buffer for caching other data. It doesn't make sense to have your buffers larger than the sum of your indexes, but the more memory you give it, the faster it will be.

InnoDB has a buffer pool for all data. You configure this based on your available memory and how much you want to give it. InnoDB buffers as much of your data in memory as possible. If you can fit the entire DB in memory, InnoDB will never read from disk. A lot of InnoDB databases see huge performance hits when the data size becomes larger than the buffer pool.

MySQL is very configurable. It's tunable to meet your needs. Typically, databases should be given as much memory as possible since they are almost always disk bound. More memory means more can be buffered.

Sign up to request clarification or add additional context in comments.

2 Comments

This is interesting. I was reading about people setting up a dedicated InnoDB box and allocating 80% of the system memory to the buffer to try and keep the entire database in memory. It sounds like this is not possible with MyISAM. Is that correct?
In MyISAM you can create additional key caches other than the default key cache,. and then load the indexes in those additional key caches,. But as Gary mentioned., since InnoDB buffers both data and indexes, and if you have enough memory then its going to give you much better performance as compared to MyISAM,.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.