Re: Is there a way to make VACUUM run completely outside

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is there a way to make VACUUM run completely outside
Date: 2005-02-07 22:01:41
Message-ID: 20050207220141.GC11229@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 07, 2005 at 07:16:41PM +0200, Hannu Krosing wrote:

> If all the changes it does to internal data storage can be rolled back,
> then I can't see how VACUUM FULL can work at all without requiring 2x
> the filesize for the ROLLBACK.

I think the point is that the table is still consistent if the system
crashes while vacuum is running. For the internal details, see Xvac in
the HeapTupleHeader struct.

> Also, why must it be run outside of transaction block if it can be
> rollbacked ?

A vacuum actually uses several transactions, so it wouldn't work as the
user would expect if run in a transaction. The first one is committed
rather early and new ones are opened and closed. (One per table, IIRC.)

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"There was no reply" (Kernel Traffic)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2005-02-07 22:02:54 PHP/PDO Database Abstraction Layer
Previous Message Mark Kirkwood 2005-02-07 21:22:09 Re: Query optimizer 8.0.1 (and 8.0)