What is the difference between:
vacuum;
and
vacuum analyze;
I read the postgresql
manual, but this is still not clear 100% for me.
Do I need to run both, or one of them is sufficient?
postgresql
What is the difference between:
vacuum;
and
vacuum analyze;
I read the postgresql
manual, but this is still not clear 100% for me.
Do I need to run both, or one of them is sufficient?
Best Answer
tl;dr running
vacuum analyze
is sufficientBecause
vacuum analyze
is complete superset ofvacuum
. If you runvacuum analyze
you don't need to runvacuum
separately. See the discussion on the mailing list archive.Analyze is an additional maintenance operation next to vacuum. It is supposed to keep the statistics up to date on the table.
More info: https://wiki.postgresql.org/wiki/Introduction_to_VACUUM,_ANALYZE,_EXPLAIN,_and_COUNT