Re: Question about (lazy) vacuum

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Gregory Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Question about (lazy) vacuum
Date: 2006-08-23 13:33:12
Message-ID: 20060823133312.GG1963@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark wrote:
>
> With all this code to handle ignoring vacuum transactions in calculating the
> global xmin it just occurred to me to wonder: Does lazy vacuum need a
> transaction at all? It doesn't do the tuple moving tricks with xvac that
> vacuum full does so does lazy vacuum's xid ever make it into tables? Couldn't
> it just use GetTopTransactionId instead of its own xid? Would this cause any
> problems?

Two points:

1. it needs to get locks

2. GetTopTransactionId returns "its own Xid" anyway ...

The point of getting locks is that it needs the lock manager to be able
to release the lock if the transaction rolls back. (The lock object
itself does not hold anything about the transaction itself AFAIR.)

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2006-08-23 13:37:36 Re: Replication
Previous Message Bruce Momjian 2006-08-23 13:28:26 Re: [HACKERS] COPY view