PDA

View Full Version : SQL Management and WP Plug ins



Harold Mansfield
10-06-2009, 06:38 PM
I see that when you install certain plug ins, they create their own little table in your SQL database.
If I am no longer using those plug ins, should I delete the tables ?
Will having those excess tables slow down my site ?

vangogh
10-06-2009, 07:14 PM
You can delete them if you want. I don't think it will slow up your site if you want to leave them. I'm not 100% sure though. Bill might know more about this. The only way I can see the extra tables slowing things down is if SQL needs to look across all tables when trying to find the specific table mentioned in a query. Not sure how it finds the table requested.

One advantage to leaving the tables is if you ever decide to install the plugin again you'll still have your old data. If you don't need the old data then there's no reason to leave the tables. Some plugins even have an uninstall option where they remove the tables for you.

Harold Mansfield
10-06-2009, 10:49 PM
You can delete them if you want. I don't think it will slow up your site if you want to leave them. I'm not 100% sure though. Bill might know more about this. The only way I can see the extra tables slowing things down is if SQL needs to look across all tables when trying to find the specific table mentioned in a query. Not sure how it finds the table requested.

One advantage to leaving the tables is if you ever decide to install the plugin again you'll still have your old data. If you don't need the old data then there's no reason to leave the tables. Some plugins even have an uninstall option where they remove the tables for you.

That is what I naturally assumed, that the tables would also be uninstalled but upon looking at one of my databases, I see old tables from plug ins that I haven't used in over a year.

I have been having some load time problems with one of my blogs and it is really got me frustrated...all the regular things that you do to speed things up are not working and I'm starting to get a little angry with my host..so I'm just looking for options and possible solutions.

vangogh
10-07-2009, 12:11 AM
The only time the tables are removed is if a plugin has an uninstaller that removes them. Most plugins don't have any uninstall. You just deactivate them and then delete the files. That never gets rid of any tables.

Might as well delete the tables. If you haven't used the plugins in over a year you're not likely to use them in the near future. And you can always export the data from the database before deleting the tables just in case you do want the data at a later point.

rezzy
10-07-2009, 01:09 AM
As far as I understand it, having unused database tables shouldnt affect your sites performance, however a poorly written plugin can.

I think the first question to determine is whats slowing your site down? Are you getting alot of hits? Try installing the super cache plugin. It basically stores a copy of your site, and lessens the servers need to pull from the database everytime.

Like I said before, have you recently installed a plugin? Some of them have been known to do crazy/dumb things, which can slow your site down.

Have you checked your server's load averages? If you are finding that your server is peaking its processor out, your host may be not balancing the load on their servers well enough.

The trouble with deleting tables, as I see it is, you could accidental delete one you actually use. Because the databases are setup with many connections you could remove the wrong one.

vangogh
10-07-2009, 01:36 AM
Good questions. I was also wondering what might be causing the slow down with the site. I'll recommend WP Super Cache too if you aren't already using it. Definitely speeds things up by serving a cached html page instead of querying the database on every request.

billbenson
10-07-2009, 01:42 AM
I would rename the table and delete it later if it doesn't create any issues. Something like rename plugin_table to t_plugin_table. Its easy to remember the original table if you find it is used for something you didn't think of. In 6 months delete all the t_xxx tables.

I can't see any reason why an old table would slow the system down unless it receives a query. If, when you removed the plugin, some php thing was left behind that shouldn't have been left behind, that could slow stuff down. Another reason to rename the table - troubleshoot the delete of a plugin.

Assuming the table isn't being accessed by anything, the only real reason to delete it is to clean everything up. So you won't be saying "what was that table for" in two years.

I've never heard of this happening, but I suppose a plugin could be a good way of getting people to install stuff that creates security breaches in a system.