Until 7.2 release is out I am looking for a way to optimize a vacuum
analyze. It currently seems to be taking about 3 hours, but I have some
time constraints and the 3 hours are happening at a time when users may
need the system.
My environment:
Posgresql 7.1.3 with buffers 6000, sort_ment 32K
FreeBSD 4.4 Stable (2 months old) with 1GB ram.
/etc/sysctl set to
kern.ipc.shmall=65535
kern.ipc.shmmax=67117056
kern.ipc.shm_use_phys=1
OS in IDE drive, "/base" directory on 10K rpm SCSI drive, pg_xlog on
second 10K rpm SCSI disk.
Nightly doing delete of about 6 million records and then re-merging.
Previously I was doing truncate, but this was an issue if a user tried to
use the system while we were loading. Now we are having a problem while
the server is running vacuum analyzes.
Does vacuum alone takes less time?
Maybe I could do deletion, load, vacuum in sequence and then do vacuum
analyze after hours.