Because VACUUM FULL completely rewrites a table into a more compact form, it seems obvious that there is never any reason to run VACUUM FULL and then run VACUUM, because the second VACUUM wouldn't have any cleanup to do.

But could the reverse -- running VACUUM and then VACUUM FULL -- ever make sense?

One hypothesis might be that VACUUM makes the subsequent VACUUM FULL run faster. If this hypothesis is true, and if you are primarily concerned with limiting the time period of the exclusive lock that VACUUM FULL needs, then it could make sense to run the two commands sequentially.

Note that I'm guessing that this hypothesis is false, given that the VACUUM FULL to my understanding rewrites the entire table. But I'm interested in the general question.

I'm running 9.3.3 in case there are version-specific wrinkles.

  • 2
    Please upgrade from that version to 9.3.11, especially if you have replication set up. – dezso Mar 1 '16 at 17:26

Your Answer

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

Browse other questions tagged or ask your own question.