pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Wall <d.wall@computer.org>
Cc: pgsql-general@postgresql.org
Subject: Re: Vacuum analyze in 7.1.1
Date: Wed, 13 Jun 2001 21:17:11 -0400
Message-ID: <15660.992481431@sss.pgh.pa.us> (raw)
In-Reply-To: <006501c0f45b$eca1c580$5a2b7ad8@expertrade.com>
References: <00c401c0f43b$a5423000$5a2b7ad8@expertrade.com>
	<3101.992468005@sss.pgh.pa.us>
	<006501c0f45b$eca1c580$5a2b7ad8@expertrade.com>

"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



view thread (8+ messages)  latest in thread

Message-ID: <15660.992481431@sss.pgh.pa.us>
Permalink:  ../15660.992481431@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15660.992481431@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, d.wall@computer.org, pgsql-general@postgresql.org
  Subject: Re: Vacuum analyze in 7.1.1
  In-Reply-To: <15660.992481431@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox