If the database is getting clogged up and not running as quickly as it should, your blog will slow down. If your database is clean and running fast, so will your blog. Its general health will carry over to other aspects of site performance.
Over time, a WordPress database generates overhead, which can be compared to the file fragments which accumulate on a hard drive. Just like defragmenting your computers hard drive helps your computer to run faster, optimizing your WordPress database does exactly the same thing.
There is no set guidelines to how often you optimize your database, i tend to do it once a week as i update my blog quite a lot, if you only up date your blog once or twice a month, then optimizing your database should only need to be done once a month.
There are two methods that you can use to optimize WordPress databases. either with the help of a plugin or manually. Doing it manually isn’t as hard as you may think, but you will need to have some knowledge of the advanced WordPress features. Using a plugin is much easier.
Doing it the manual way is much more time consuming, but means you don’t need to add more plugins to your blog which can slow it down a little.
Word Of Warning: To optimize manually you will need to use phpMyAdmin through your blogs server. If you are not 100% sure, then please skip the manual method and use a plugin. Login to phpMyAdmin and choose the database associated with your WordPress blog.
Then select all rows with a value greater than zero in the ‘Overhead’ column, and choose ‘Optimize Database.’ That’s it. Then simply repeat this either once a week for busy blogs or monthly if your blog isnt updated that often.
Optimizing using a Plugin:
If you are not 100% sure about manually doing this, then there are plenty of plugins to help you. Im only going to tell you about one these plugins as its the one i use on my blog, and probably the best plugin available for free.
WP-Optimize Installing the plugin is easy, just goto ‘add new’ from your admin sidebar and search for WP-Optimize. Then simply install and activate. Once you have enabled the plugin, you will see the WP-Optimize options in your admin sidebar.
Select it to open the plug-in, which will bring you to a list of revisions and comments which it can delete. If you’re so inclined, review the spam comments to verify that they are, in fact, spam, and then check all the boxes to maximize optimization.
If you scroll down, the plug-in will also show you a list of optimized tables, and show how much space you saved in each.
Additionally, this plug-in has a neat extra feature that allows you to change your WordPress username. All told, a very useful plug-in that should improve your load times considerably.