Re: VACUUM touching file but not updating relation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Thom Brown <thom(at)linux(dot)com>, PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VACUUM touching file but not updating relation
Date: 2011-11-18 15:18:46
Message-ID: 16210.1321629526@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On Fri, Nov 18, 2011 at 2:47 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Well, it's expected given the current coding in the btree vacuum logic.
>> It's not clear to me why it was written like that, though.

> The code works as designed.

> _bt_delitems_vacuum() is only ever called with nitems == 0 when it is
> the last block of the relation with wal_level = hot standby

> As discussed in the comments we must issue a WAL record for the last
> block, whatever else has occurred.

> So the correct number of WAL records is emitted and I see no bug there.

What Thom's complaining about is that the buffer may be marked dirty
unnecessarily, ie when there has been no actual data change.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2011-11-18 15:25:12 Re: VACUUM touching file but not updating relation
Previous Message Simon Riggs 2011-11-18 15:12:43 Re: VACUUM touching file but not updating relation

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-11-18 15:25:12 Re: VACUUM touching file but not updating relation
Previous Message Simon Riggs 2011-11-18 15:12:43 Re: VACUUM touching file but not updating relation