Optimizing those MySQL database tables
Optimizing a website normally means getting everything to run at the fastest speed possible. From an accessibility viewpoint this is quite important as we want even the dial-up users to be able to use our sites.
On this site I have taken a look at general ways of speeding up one’s site or blog but what about those MySQL database tables? Should these be optimized as well?
Through time a database does manage to collect quite a bit of dead overhead because of items we might delete as well as various other factors. To delete this overhead means that you will be making the database smaller. A smaller database means faster load-up times, doesn’t it. To me this seems logical but still if you Google a bit regarding table optimization you will find conflicting views on this topic. Some say it is something that should be done occasionally, others say it should be done regularly, and still others say it should never be done as it does not really serve a purpose.
On this site I cannot really test this for myself. This site is only a month old. This means the database is very small and I cannot determine if optimization of the tables has any affect or not.
I would appreciate it if someone with more knowledge on this topic than myself could steer me in the correct direction. Should we optimize those tables or should we not?
Either way, if you are interested, this is how you optimize MySQL tables in phpMyAdmin:
Once you have opened phpMyAdmin click on the name of your database on the left of the page. In my case the database is called Wordpress.

This will open another page showing all the tables in your database. At the bottom of this page click the link that reads ‘Check tables having overhead’.

All the tables in your database having overhead will now have a check mark next to them.

Again go to the bottom of the page and select ‘optimize table’ in the selection box provided.
![]()
That’s it. Another page will open confirming that the checked tables were indeed optimized.
As already stated, I do not know if this will indeed change the size of the database, but the tables will have been optimized. Use this information if you think it could help or else just file this info as just another ‘nice to know’.
These posts might be related:








Hi, my name is Lyndi. Here we talk about all things related to WordPress. You are more than welcome to join in the discussion.


There are currently 107 posts with 952 comments on this blog.
Thanks for sharing this. For the startup entrepreneur who is a one man-squad webmaster/designer/marketer etc. This tip can be a time saver.
Cheers.
Thanks for dropping by.
Thanks for the tips, this surely help me alot as one of my blog has been forced down couple days ago because of the overusage of its database, by optimizing them like your suggestion, now I will not have to lost my baby again
Shearyadi, I am glad you could use the information.
can the overhead be determined using query so that a routine in say php can optimize or repair the table when there is an overhead ?
lito, I hope that I understand your query correctly. As far as I know you can determine the overhead of a database as well as optimize the tables should it be necessary, via a SQL script. I remember something like this but that was for an Oracle database I was working on many years ago. I suggest you get hold of a SQL specialist to give you a decent answer to this one.