Re: Vacuum analyze in 7.1.1 - Mailing list pgsql-general

From Tom Lane
Subject Re: Vacuum analyze in 7.1.1
Date
Msg-id 15660.992481431@sss.pgh.pa.us
Whole thread Raw
In response to Re: Vacuum analyze in 7.1.1  ("David Wall" <d.wall@computer.org>)
List pgsql-general
"David Wall" <d.wall@computer.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

pgsql-general by date:

Previous
From: Ian Lance Taylor
Date:
Subject: Re: Log files, how to rotate properly
Next
From: "Joe Conway"
Date:
Subject: Re: Re: Does PostgreSQL support EXISTS?