Patrick Donlin <pdonlin(at)oaisd(dot)org> wrote:
> I have run vacuumdb --full --analyze, it
> actually runs as a nightly cron job.
That's usually not wise -- VACUUM FULL can cause index bloat, and is
not normally necessary. If you have autovacuum turned on and run a
database vacuum each night, you can probably avoid ever running
VACUUM FULL. A long-running transaction or mass deletes might still
make aggressive cleanup necessary on occasion, but you should
consider using CLUSTER instead of VACUUM FULL. So, you should
probably change your crontab job to vacuum --all --analyze.
Also, after a bulk load of a database like this you might consider a
one-time VACUUM FREEZE of the database. Without that there will
come a time when autovacuum will need to rewrite all rows from the
bulk load which haven't subsequently been modified, in order to
prevent transaction ID wraparound problems.
-Kevin