WordPress.org

Ready to get started?Download WordPress

Forums

SQL Purge of Post Revisions before and after? (19 posts)

  1. waffenss
    Member
    Posted 1 year ago #

    I noticed the crazy amount of post revisions for every post i had so i did some searching and purge unused revisions from my database.

    The questions is does this sound right about the SQL size now?

    Before:
    MySQL Disk Space 76.68 MB
    Actual Backup file size 45MB

    After:
    MySQL Disk Space 76.68 MB
    Actual Backup file size 9.84MB

    That is a huge drop in size I am showing no errors anywhere the purge was successful over 600 post checked older ones still valid data.

    The purge code was
    DELETE FROM wp_posts WHERE post_type = "revision";

  2. bottleneck
    Member
    Posted 1 year ago #

    You are perfectly right and safe.

    I run the same query once in a while and reduce my database size dramatically.

    That

    define('WP_POST_REVISIONS', false );

    never works for me.

  3. waffenss
    Member
    Posted 1 year ago #

    That is insane if revisions were taking up 35MB of space.

    I noticed that code also but did not attempt it.

  4. bottleneck
    Member
    Posted 1 year ago #

    :)

  5. waffenss
    Member
    Posted 1 year ago #

    Thanks for confirming you run it as well!

  6. bottleneck
    Member
    Posted 1 year ago #

    Sure, you are welcome!

    We are in the same sinking boat (just kidding)

  7. waffenss
    Member
    Posted 1 year ago #

    Curious to why the MySQL Disk Space is still showing 76.68 MB though when backup is under 10MB

  8. bottleneck
    Member
    Posted 1 year ago #

    backup is under 10MB

    Did you gzip it?

  9. waffenss
    Member
    Posted 1 year ago #

    no just ran the flush

    10MB SQL text export

  10. bottleneck
    Member
    Posted 1 year ago #

    I think it isn't a big deal.

    Consider this as another adventure which you would pass :)

  11. bottleneck
    Member
    Posted 1 year ago #

    Hey,

    I guess you need to optimize database by clearing 'overhead'

    It works for me.

  12. waffenss
    Member
    Posted 1 year ago #

    Overhead cleared!

    MySQL Disk Space 77.06 MB
    Export Text Size 9.93 MB

    That is strange do you have the same results?

    Are we the only 2 that have done this no Dev response or anything?

  13. bottleneck
    Member
    Posted 1 year ago #

    Good.

    no Dev response or anything

    I guess they consider this as an April Fools Day joke.

    I keep running that query for a long time so I don't have such extreme purges.

    But the idea remains the same.

  14. waffenss
    Member
    Posted 1 year ago #

    I also went to database and selected all rows run a repair on all rows.

    This was a more detailed post on how to just another step i went ahead and did.

    http://diywpblog.com/wordpress-database-optimization-cleaning-up-your-mess/

    Seems site load time has also dropped over 1 second from

    NY 2.54s
    Netherlands 5.21s

    Dallas based

  15. bottleneck
    Member
    Posted 1 year ago #

    oh, very nice.

    Thanks!

    I will replace my current

    define('WP_POST_REVISIONS', false );

    with

    define( 'WP_POST_REVISIONS', 0);

    and will keep my fingers crossed. :)

  16. bottleneck
    Member
    Posted 1 year ago #

    By the way, what site do you use for checking a load time?

  17. waffenss
    Member
    Posted 1 year ago #

    pingdom

  18. bottleneck
    Member
    Posted 1 year ago #

    :)

  19. RichardWantsToKnow
    Member
    Posted 1 year ago #

    Great thread!

    Now, does anyone have a way to purge the post-meta table of the litter from uninstalled plugins?

Topic Closed

This topic has been closed to new replies.

About this Topic