Database

MySQL Table Overhead

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.

MySQL Table Over Head

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]

Shares:
  • Suneel
    October 9, 2011 at 12:14 pm

    Nice tip there Avinash. Will check my backend once for this :)

    Reply
  • Mohamad Sibai
    October 9, 2011 at 2:26 pm

    Thanks Avinash,

    As far as I know this is applied for MyISAM not InnoDB.

    BR

    Reply
  • hosein
    August 22, 2012 at 1:06 pm

    hi, thank you for this article, i see overhead on my db

    shouldnt worry about remove my data with OPTIMIZE command?

    Reply
  • Overhead mysql | Luxrewards
    September 13, 2012 at 12:05 pm

    […] 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 … […]

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *