Forum Moderators: open

Message Too Old, No Replies

Question about MySQL DB Overhead Column

         

Gian04

4:18 am on Aug 24, 2007 (gmt 0)

10+ Year Member



Viewing my MySQL DB on phpMyAdmin, it shows 7 columns:
Table ¦ Action ¦ Records ¦ Type ¦ Collation ¦ Size ¦ Overhead

My question is What is the OVERHEAD column? Some table has value like 72K while others are blank.

dmorison

6:57 am on Aug 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you delete a row from a table, the data is only marked as deleted - it is not physically removed from disk. This creates an "overhead" of empty space in the file that holds that particular table on disk. New rows may be inserted in place to fill the dead space, but the only way to completely remove it is to OPTIMIZE the table, which you should be able to do using any MySQL admin tool, or write a quick script to fire off an "OPTIMIZE TABLE tablename" query.

If you're doing it in PHP, make sure to use set_time_limit(0) in your script incase the operation takes some time...