pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ivan Kartyshov <i.kartyshov@postgrespro.ru>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: less expensive pg_buffercache on big shmem
Date: Fri, 2 Sep 2016 14:38:38 +0300
Message-ID: <479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru> (raw)
In-Reply-To: <CA+TgmoZqSrHH2qpBTs2EmsFwnxhLGN7iAgK8RtCz4Kqvps4Xzw@mail.gmail.com>
References: <f9d6cab2-73a7-7a84-55a8-07dcb8516ae5@postgrespro.ru>
	<CA+TgmoZqSrHH2qpBTs2EmsFwnxhLGN7iAgK8RtCz4Kqvps4Xzw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 09/02/2016 06:01 AM, Robert Haas wrote:
> I wonder whether we ought to just switch from the consistent method to
> the semiconsistent method and call it good.  I agree with you that
> taking every buffer partition lock simultaneously seems like too much
> locking.  And in the future if we replace the buffer mapping hash with
> something that is lock-free or close to it, then we wouldn't even have
> buffer partition locks any more, and probably no way at all to get an
> entirely consistent snapshot.
> What do you think of this?

I fully agree with you that it would be preferred in the future to 
replace the buffer mapping hash with some of lock-free algorithms.

In the question of replacing the consistent method I agree with you, 
Andres Freund and Peter Geoghegan: the consistent method does not bring 
any considerable benefits.

You might be right regarding the three different modes, but our DBAs 
asked if we could preserve a legacy mode too, thus the choice.

On 09/02/2016 06:19 AM, Andres Freund wrote:
  > +1. I think, before long, we're going to have to switch away from having
  > locks & partitions in the first place. So I don't see a problem relaxing
  > this. It's not like that consistency really buys you anything...  I'd
  > even consider not using any locks.

If we will replace consistent method, then we should replace it with the 
partially consistent method (called "nonconsistent") because:
1) it's based on fast spinlocks (it's not fully up to its name, though)
2) it's *almost* the fastest one (the less time needed for execution of 
method, the less data core will change and as a consequence the more 
consistent snapshot will be)
3) and it has less influence on the entire system during query processing.

On 09/02/2016 06:30 AM, Peter Geoghegan wrote:
  > I would like to be able to run pg_buffercache in production from time
  > to time.

Yes, in our experience the usage of fully consistent pg_buffercache in
production is quite a courageous decision.


---
Ivan Kartyshov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (14+ messages)  latest in thread

Message-ID: <479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru>
Permalink:  ../479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru/
Also on:    postgresql.org/message-id/479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: i.kartyshov@postgrespro.ru, robertmhaas@gmail.com
  Subject: Re: less expensive pg_buffercache on big shmem
  In-Reply-To: <479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru>
  References: <f9d6cab2-73a7-7a84-55a8-07dcb8516ae5@postgrespro.ru> <CA+TgmoZqSrHH2qpBTs2EmsFwnxhLGN7iAgK8RtCz4Kqvps4Xzw@mail.gmail.com> <479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru>

* 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