Re: checkpointer continuous flushing - Mailing list pgsql-hackers

From Robert Haas
Subject Re: checkpointer continuous flushing
Date
Msg-id CA+TgmoaP=BTU5G8MH4gkbVyR=OtXOn3GcHfn7xYyd+oPjk8e3g@mail.gmail.com
Whole thread Raw
In response to Re: checkpointer continuous flushing  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Wed, Jan 20, 2016 at 9:02 AM, Andres Freund <andres@anarazel.de> wrote:
> Chatting on IM with Heikki, I noticed that we're pretty pessimistic in
> SetHintBits(). Namely we don't set the bit if XLogNeedsFlush(commitLSN),
> because we can't easily set the LSN. But, it's actually fairly common
> that the pages LSN is already newer than the commitLSN - in which case
> we, afaics, just can go ahead and set the hint bit, no?
>
> So, instead of
>                 if (XLogNeedsFlush(commitLSN) && BufferIsPermanent(buffer)
>                         return;                         /* not flushed yet, so don't set hint */
> we do
>                 if (BufferIsPermanent(buffer) && XLogNeedsFlush(commitLSN)
>                         && BufferGetLSNAtomic(buffer) < commitLSN)
>                         return;                         /* not flushed yet, so don't set hint */
>
> In my tests with pgbench -s 100, 2GB of shared buffers, that's recovers
> a large portion of the hint writes that we currently skip.

Dang.  That's a really good idea.  Although I think you'd probably
better revise the comment, since it will otherwise be false.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: GIN pending list clean up exposure to SQL
Next
From: Robert Haas
Date:
Subject: Re: Fwd: Core dump with nested CREATE TEMP TABLE