WordPress has a nice little feature of saving revisions of your posts whilst you’re editing them. This is great if you need to roll back to a previous revision. However, after you’ve published a post, it’s unlikely you’ll need the old revisions.
The following SQL can be used to delete the old post revisions and free up some space for your database.
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = 'revision'
Of course, it’s a good idea to back up your database prior to deleting anything.
If you don’t want or need post revisions, you can add this line to your
config.php to turn them off completely.