Re: Vacuum analyze in 7.1.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David Wall" <d(dot)wall(at)computer(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Vacuum analyze in 7.1.1
Date: 2001-06-14 01:17:11
Message-ID: 15660.992481431@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

"David Wall" <d(dot)wall(at)computer(dot)org> writes:
> The docs say that VACUUM:

> "VACUUM opens every table in the database, cleans out records from rolled
> back transactions, and updates statistics in the system catalogs. The
> statistics maintained include the number of tuples and number of pages
> stored in all tables."

> Isn't also true that VACUUM cleans out deleted and updated rows for
> committed transactions?

Okay. As far as the VACUUM reference page goes, that's already changed
for 7.2 --- you might like to look at

http://www.ca.postgresql.org/devel-corner/docs/postgres/sql-vacuum.html

The current description there is:

VACUUM reclaims storage occupied by deleted tuples. In normal Postgres
operation, tuples that are DELETEd or obsoleted by UPDATE are not
physically removed from their table; they remain present until a VACUUM
is done. Therefore it's necessary to do VACUUM periodically, especially
on frequently-updated tables.

With no parameter, VACUUM processes every table in the current
database. With a parameter, VACUUM processes only that table.

VACUUM ANALYZE performs a VACUUM and then an ANALYZE for each selected
table. This is a handy combination form for routine maintenance
scripts. See ANALYZE for more details about its processing.

(The last para refers to the fact that ANALYZE is also available as a
separate command in 7.2; that wasn't true before.)

I was mainly wondering if you'd come across any misstatements other than
on the command reference page...

> And for those who use large objects, I understand that vacuum now
> cleans those up when they are deleted as well (no need for vacuumlo
> anymore).

Mmm, not really. As of 7.1, VACUUM will clean up space occupied in
pg_largeobject by deleted or modified LOs. However, it doesn't try to
detect whether an LO still has any references or not, so you still need
vacuumlo if your application is not careful to issue lo_unlink at all
the right times. Not sure where this should be documented. The docs
on large objects are pretty bad anyway :-(

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2001-06-14 01:28:27 Re: Re: Does PostgreSQL support EXISTS?
Previous Message Dave Cramer 2001-06-14 01:05:06 Re: Log files, how to rotate properly

Browse pgsql-interfaces by date

  From Date Subject
Next Message David Wall 2001-06-14 04:01:08 Re: Vacuum analyze in 7.1.1
Previous Message David Wall 2001-06-13 22:55:21 Re: Vacuum analyze in 7.1.1