Avoid future disaster with InnoDb + MySQL

InnoDb is a storage engine in MySQL that provides lots of nice features as opposed to MyISAM.

If you’re using the InnoDb table type in MySQL to store lots of data, you should be aware of this configuration key:

innodb_file_per_table

With that added to your my.cnf configuration file, MySQL will place each InnoDb table into its own data file instead of putting them all into a single data file.

If you ever truncate or drop an InnoDb table later, the disk space will not be reclaimed and your ibdata1 file will not shrink.

This could get messy if your database is around for years to come and you’re running, say, a high-traffic web site or application.

Heikki Tuuri, creator of InnoDb, says: “unfortunately, the only way to shrink ibdata files is to reload the entire database.”

Ouch.

More information: MySQL Bug 1341

3 notes

  1. bliptvtech reblogged this from jaredklett
  2. mikehudack reblogged this from jaredklett
  3. jaredklett posted this