Postgres Vacuum Cleaners

Peter Corlett abuse at
Mon Nov 20 14:21:13 GMT 2006

On Mon, Nov 20, 2006 at 01:59:31PM +0000, Peter Haworth wrote:
> Here's my limited understanding:
> * "analyze"  is what rebuilds the stats
> * "vacuum" is like defragging a disk
> * "vacuum analyze" combines the first two
> * "vacuum full" is like vacuum, but also truncates the files to the
>   minimum possible size

The analogy is poor; CLUSTER is more akin to defragging a disk: it sorts
tables by an index so that sequential access is faster. Plain VACUUM is just
a garbage-collector and doesn't make any attempt to consolidate the
allocated regions. I *think* a VACUUM FULL might also do a CLUSTER as a

The rest of your post is pretty much correct though.

More information about the mailing list