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


From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VACUUMs and WAL
Date: 2008-10-28 12:45:48
Message-ID: 1225197948.7694.11.camel@huvostro (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Tue, 2008-10-28 at 14:28 +0200, Heikki Linnakangas wrote:
> Hannu Krosing wrote:
> > On Tue, 2008-10-28 at 10:10 +0000, Simon Riggs wrote:
> >> On Tue, 2008-10-28 at 11:45 +0200, Hannu Krosing wrote:
> >>> On Tue, 2008-10-28 at 08:49 +0000, Simon Riggs wrote:
> >>>> 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.
> >>> IIRC the first heap pass just collects info and does nothing else. 
> >>> Is this just an empty/do-nothing WAL record ?
> >> 8.3 changed that; it used to work that way. I guess I never looked at
> >> the amount of WAL being generated.
> > 
> > I can't see how it is safe to do anything more than just lookups on
> > first pass. 
> What's done in the first pass is the same HOT pruning that is done 
> opportunistically on other page accesses as well. IIRC it's required for 
> correctness, though I can't remember what exactly the issue was.

Are you sure it is a correctness thing ? Maybe HOT pruning just happened
to be in a path used by vacuum to read pages.

> I don't think the extra WAL volume is a problem; 

Probably not ( unless you need to ship your WAL records via a very
expensive network connection ).

If it is a simple performance problem, then it can probably be fixed by
just running VACUUM slower.

> VACUUM doesn't generate 
> much WAL, anyway. As for the extra data page writes it causes; yeah, 
> that might cause some I/O that could be avoided, but remember that the 
> first pass often dirties buffers anyway to set hint bits.

Still, can't we special-case HOT pruning and hint-bit change WAL-logging
for first the pass of vacuum ? They both seem redundant in case of


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-10-28 12:55:07
Subject: Re: Window Functions: v07 APIs and buffering strateties
Previous:From: Heikki LinnakangasDate: 2008-10-28 12:44:57
Subject: Re: Proposal of PITR performance improvement for 8.4.

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