> >From http://www.postgresql.org/docs/user/sql-vacuum.htm
> >
> >VACUUM serves two purposes in Postgres as both a means to reclaim
> >storage and also a means to collect information for the optimizer.
>
> I'm guessing here, but it would seem to me that once the 'reclaim' portion
> was written, it probably seemed like a good a place as any to put the
> stat-collecting code? As long as the entire database was being scanned
> anyway, why not collect statistics.
Yes, that was the idea. While doing one, why not do the other.
>
> Perhaps its time for the two functions to be separated - controlled by an
> option?
> Perhaps VACUUM STATONLY could collect stats, not lock table and not reclaim
> space.
Makes sense.
> Actually, I'm thinking any seq-scan could collect the stats on the way
> through?
We have thought about that, at least to count the number of rows.
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026