pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Hannu Krosing <hannu@2ndQuadrant.com>
Cc: Simon Riggs <simon@2ndQuadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: VACUUMs and WAL
Date: Tue, 28 Oct 2008 14:28:01 +0200
Message-ID: <49070551.1090903@enterprisedb.com> (raw)
In-Reply-To: <1225196344.7694.2.camel@huvostro>
References: <1225183785.3971.114.camel@ebony.2ndQuadrant>
	<1225187130.7721.5.camel@huvostro>
	<1225188645.3971.118.camel@ebony.2ndQuadrant>
	<1225196344.7694.2.camel@huvostro>

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.

I don't think the extra WAL volume is a problem; 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.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (11+ messages)  latest in thread

Message-ID: <49070551.1090903@enterprisedb.com>
Permalink:  ../49070551.1090903@enterprisedb.com/
Also on:    postgresql.org/message-id/49070551.1090903@enterprisedb.com

 · 

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-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, hannu@2ndQuadrant.com, simon@2ndQuadrant.com
  Subject: Re: VACUUMs and WAL
  In-Reply-To: <49070551.1090903@enterprisedb.com>

* 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