Question

I just saw in phpMyAdmin that one of our MySQL tables is 14MB in size, but has 10MB overhead. I'm guessing this is a lot!

How much is too much? Should I run OPTIMIZE TABLE regularly?

Was it helpful?

Solution

"Overhead" is not yet reclaimed space formerly occupied by now deleted records. If you're doing a lot of inserts / deletes, it's pretty much always going to be there. You can run OPTIMIZE TABLE, but I wouldn't bother - especially on large tables (14M is not large, though) where it can take a lot of time.

OTHER TIPS

To tidy up data table one can just use:

ALTER TABLE table_name_here ORDER BY primary_key_here;

which could run faster than OPTIMIZE TABLE.

This will de-fragment the data file. After extensive changes to a table, this may also improve performance of statements that use the table, sometimes significantly.

http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top