Skip site navigation (1) Skip section navigation (2)

Re: VACUUMs and WAL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VACUUMs and WAL
Date: 2008-10-28 12:42:14
Message-ID: 18666.1225197734@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> Looking at a VACUUM's WAL records makes me think twice about the way we
> issue a VACUUM.

> 1. First we scan the heap, issuing a HEAP2 clean record for every block
> that needs cleaning.

> 2. Then we scan the index, issuing WAL records as appropriate.

> 3. Then we rescan the heap, issuing a HEAP2 clean record for every
> block.

The first pass removes dead HOT tuples.  The second pass removes dead
normal tuples (it does NOT write "every block", only those with dead
tuples).  In principle the set of pages written in pass 1 might be
completely disjoint from the set of pages written in pass 2 (though
I admit that's probably not real likely).

> Surely we can come up with a better plan than that one?

Maybe, but it's not as bad as you're painting it.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2008-10-28 12:44:57
Subject: Re: Proposal of PITR performance improvement for 8.4.
Previous:From: Tom LaneDate: 2008-10-28 12:36:23
Subject: Re: VACUUMs and WAL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group