Re: checkpointer continuous flushing

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: checkpointer continuous flushing
Date: 2016-01-28 04:01:49
Message-ID: CA+TgmoaP=BTU5G8MH4gkbVyR=OtXOn3GcHfn7xYyd+oPjk8e3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 20, 2016 at 9:02 AM, Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-01-28 04:04:33 Re: Fwd: Core dump with nested CREATE TEMP TABLE
Previous Message Fujii Masao 2016-01-28 04:00:26 Re: GIN pending list clean up exposure to SQL