MySQL - MyISAM tables and large index (.myi) files

This is just a quick note, incase it helps someone else in the future.

It seems that MySQL server, when using MyISAM tables doesn't truncate the index file when you run "ALTER TABLE x DISABLE KEYS", so when running "ALTER TABLE x ENABLE KEYS" you end up with an MyISAM index file (xxxx.myi) which keeps growing. In my case this hit 90gb on a customer's server.

Ways to fix this :

  1. Upgrade to MySQL 5.0.52 (apparently ... see
    http://bugs.mysql.com/bug.php?id=4692
    )
  2. Run "optimize table xxxx"
  3. Run "repair table xxxx quick use_frm"
  4. Nuke it from orbit, it's the only way to be sure.
Technorati Tags:

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.
9 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.