New Database Home for Plugins and Themes (5 posts)

  1. monk3
    Posted 2 years ago #

    Recently, we experienced significant slowdowns on a WordPress site we have had running for about a year and a half.
    Investigating, we found that our database for the site had grown to 500,000+ lines of entries. Of those, 300,000+ were in the postmeta table.

    Obviously, we needed to clean that out. We began by eliminating 'revisions' of posts. That helped a little, but not much. In reading the WordPress Codex, we found that plugin and theme data is also stored in that table. Problem is, there isn't any intuitive way to remove all the entries for plugins and themes that have been removed previously. (It was obvious to us that the authors of those plugins and themes appeared to have no interest in writing uninstall modules for their offerings. The entries are scattered throughout the table and don't follow any rhyme nor reason.)

    So, might I suggest, that in a future rev of WordPress, maybe new tables, one (or a set) for plugins another for themes, become a WordPress standard, and the criteria for those products be that they be written to use the new tables.

  2. Themes and plugins are supposed to remove their content when uninsyalled. Not all do :/

  3. monk3
    Posted 2 years ago #

    Yes, that is the problem; and currently, there isn't any way to police it. Just too many to track.
    That's exactly why I believe it's time to put them into separate tables in the database, so that we can at least admin the situation without having to go through the postmeta table line-by-line. When that table gets to over 100,000 records, and each record may have dependencies with other tables, the way it exists today, it's near-impossible to clean the table.

  4. It would be exceptionally complicated to do that and support every plugin out there today. Also plugins put things into wp_options, NOT wp_postmeta, so it wouldn't help you at all.

  5. The postmeta table is a meta table meaning that it contains meta information relating to a specific post. If it is being used as a meta table then it should not cause any slowdowns because the values are only loaded (and cached) when the post it is related to is loaded.

    This is a simple very low overhead query using the post_id column to retrieve the data. If you are using the postmeta data to sort or query from then you have a problem because it has to be joined with the posts table and that will slow your site down unless you know how to properly cache those queries.

    Plugins do not store arbitrary information in postmeta unless it is information relating to a post which you would need.

Topic Closed

This topic has been closed to new replies.

About this Topic