If you are familier with the PhpMyAdmin then you might have seen the column overhead in the table listing page. So what is this table overhead?
So I am trying to explain this in very simple way as much I can:
Whenever you delete rows from the MySQL tables, it creates a unoccupied space in the table. MySQL will remember this unoccupied space and it will use this space when there is INSERT operation on database.
MySQL have to remember this empty space even though it have no data stored. :)
Note: MySQL table overhead is actual size of a table datafile relative to the ideal size of the same datafile.
Any problem with Table Overhead?
There will not be any problem if overhead is in smaller size. But it is recommended to remove this overhead if its in larger size.
How to remove Table Overhead?
We can optimize the table to remove the table overhead.
[cc lang=”mysql”]
OPTIMIZE table table_name;
[/cc]
Nice tip there Avinash. Will check my backend once for this :)
Thanks Avinash,
As far as I know this is applied for MyISAM not InnoDB.
BR
Hi Mohamad Sibai,
You are right… :)
hi, thank you for this article, i see overhead on my db
shouldnt worry about remove my data with OPTIMIZE command?
[…] MySQL Table Overhead | Expert PHP DeveloperOct 7, 2011 … Whenever you delete rows from the MySQL tables, it creates a unoccupied space in the table. MySQL will remember this unoccupied space … […]