Support » Fixing WordPress » SQL Purge of Post Revisions before and after?

  • waffenss

    (@waffenss)


    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";

Viewing 15 replies - 1 through 15 (of 18 total)
  • bottleneck

    (@bottleneck)

    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.

    waffenss

    (@waffenss)

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

    I noticed that code also but did not attempt it.

    bottleneck

    (@bottleneck)

    🙂

    waffenss

    (@waffenss)

    Thanks for confirming you run it as well!

    bottleneck

    (@bottleneck)

    Sure, you are welcome!

    We are in the same sinking boat (just kidding)

    waffenss

    (@waffenss)

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

    bottleneck

    (@bottleneck)

    backup is under 10MB

    Did you gzip it?

    waffenss

    (@waffenss)

    no just ran the flush

    10MB SQL text export

    bottleneck

    (@bottleneck)

    I think it isn’t a big deal.

    Consider this as another adventure which you would pass 🙂

    bottleneck

    (@bottleneck)

    Hey,

    I guess you need to optimize database by clearing ‘overhead’

    It works for me.

    waffenss

    (@waffenss)

    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?

    bottleneck

    (@bottleneck)

    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.

    waffenss

    (@waffenss)

    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.

    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

    bottleneck

    (@bottleneck)

    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. 🙂

    bottleneck

    (@bottleneck)

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

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘SQL Purge of Post Revisions before and after?’ is closed to new replies.