5

I have read numerous times that I should clean up my database to keep performance high. Keeping multiple revisions of posts is always cited as a big performance stealer.

I'm suspicious of this claim. I get that the table will be significantly larger with 10 revisions than 2, but will it really be slower in operation? Given that there are indexes (or should be) on the fields you look things up on frequently, queries should still be nearly as quick.

I can't see any difference in my own sites, but I don't have that much data. I'm curious at what point, sizewise any improvement would actually start to show up, if indeed one ever does.

I'm not arguing for site owners to up the number of revisions they want to keep, I'm just trying to understand the real world effect, compared to the big performance improvement claims I so often see.

1
  • I have the same question. I've seen a study that showed there was zero to negligible impact on performance with and without revisions. I have seen zero evidence showing site speed performance degradation when revisions are enabled. If anyone has data to suggest otherwise, please let us know. Feb 16, 2018 at 12:41

5 Answers 5

5

Having 2 revisions or 100,000 will not change front end performance in a default plugin-less WordPress setup

However plugin and theme authors who do not query the database correctly, could end up accidentally searching/querying revisions, which could have some performance issues

Here’s a snippet on it

revisions take up space in your WordPress database. Some users believe that revisions can also affect some database queries run by plugins. If the plugin doesn’t specifically exclude post revisions, it might slow down your site by searching through them unnecessarily

1
  • Yes, that's possible, and I hadn't thought of it. But how much sense does it make to code for other people's possible mistakes? Jan 7, 2018 at 3:01
1

No. Databases are smart, for the most part. If you have performance issues, then you need to find the actual problem and solve that directly. Having millions of rows in a well indexed database won't make any real difference. That's why indexes exist.

0

Yes, it will affect performance to some degree. Revisions are stored in the database and if the database stores too much revision data then it will eventually affect site performance.

Best thing to do is limit revision count in your wp-config.php

define( 'WP_POST_REVISIONS', 3 );
5
  • 1
    But why will it be slower, given that indexes are in use. I know how to minimize revisions, I want to know why it matters in the world of modern databases. Jan 7, 2018 at 1:45
  • Here, maybe this link will clear this up: wpengine.com/support/… Jan 7, 2018 at 18:18
  • 1
    Wow, WP Engine is being pretty heavy handed there, I'll have to remember that if I'm ever looking for a new host. Clearly, they agree with you. But how does WP perform well for some who have millions of records if it can't perform well for the average Joe who has revisions? I may be wrong, but I remain unconvinced. Jan 7, 2018 at 20:39
  • WP Engine is a very reputable host for wordpress. I trust them for our best and most visited clients. They have more back end experience than I have concerning web serving hosting. That being said, they are the only web server hosting company that specifically recommend limiting post revisions. Jan 8, 2018 at 1:47
  • 1
    They do have a very good reputation. I was very surprised to see this behavior from them. Jan 8, 2018 at 2:26
0

I don't have the reputation to merely comment, but I believe that this question of post revisions affecting performance is still relevant today.

There are two sides to this question of performance, the frontend and the backend (admin). One of my sites developed a problem where just a single page post was taking over two minutes to load in the editor.

It was hard to troubleshoot as there was nothing in the PHP error log. The plugin "Query Monitor" said that there was just 257 database ops taking a total time of .31 seconds.

There were no other performance issues on the frontend or backend. On the client side, the console reported a bunch of deprecated react components. The network waterfall showed a steady progression, but difficult for me to understand the cause from this information.

Everything looked fine. To complicate matters, the editor would randomly load up the post in just over two seconds.

There was nothing special about the page post except that it had 32 revisions which was way beyond every other post on the site. I trashed the original post and re-created it. Problem solved.

I believe that the high number of revisions was the cause of the very slow loading time. To avoid this in the future, I have set max revisions to 4. It seems to me that this should be set to a sensible default as a best practice.

I know this is long winded, but I am hopeful that it will save someone else a few hours of head scratching.

0

In my case, deleting post revisions improved my site performance drastically. The average load time before and after clearing revisions from database were 10 seconds and 2 seconds respectively. I disabled post revisions in wp-config.php and cleaned my database using the sweep plugin. I run websites in ec2, this method even reduced my server infrastructure requirement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.