pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Greg Stark <stark@mit.edu>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Rajeev rastogi <rajeev.rastogi@huawei.com>
Cc: Ants Aasma <ants@cybertec.at>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Markus Wanner <markus@bluegap.ch>
Subject: Re: Proposal for CSN based snapshots
Date: Tue, 26 Aug 2014 13:45:25 +0300
Message-ID: <53FC6545.7000501@vmware.com> (raw)
In-Reply-To: <1409043789.2335.330.camel@jeff-desktop>
References: <51B6C97B.1070000@bluegap.ch>
	<BF2827DCCE55594C8D7A8F7FFD3AB7713DDBC758@SZXEML508-MBX.china.huawei.com>
	<5370D323.1070606@vmware.com>
	<20140512144112.GB9619@awork2.anarazel.de>
	<5370E267.2020904@vmware.com>
	<20140515183436.GD25053@momjian.us>
	<CA+TgmoYiqga4KWz_1=O8D6ivmTAJfY=-fxO6Nk+D-o3M0M60=Q@mail.gmail.com>
	<20140515200632.GB16014@awork2.anarazel.de>
	<20140515213714.GB7857@eldon.alvh.no-ip.org>
	<53889CCB.7030005@vmware.com>
	<20140530152721.GC30516@awork2.anarazel.de>
	<5388D02D.6040305@vmware.com>
	<CA+TgmoZ4cP_1Pavwn+VX74_ksDhHf-whO5FFR1j+NdZqONu8MA@mail.gmail.com>
	<CAM-w4HMG-YeTfWc3r_excej3Kd04q4zDDXR0hxShVbij211ABA@mail.gmail.com>
	<539AD153.9000004@vmware.com>
	<1409043789.2335.330.camel@jeff-desktop>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 08/26/2014 12:03 PM, Jeff Davis wrote:
> On Fri, 2014-06-13 at 13:24 +0300, Heikki Linnakangas wrote:
>> Attached is a new patch. It now keeps the current pg_clog unchanged, but
>> adds a new pg_csnlog besides it. pg_csnlog is more similar to
>> pg_subtrans than pg_clog: it's not WAL-logged, is reset at startup, and
>> segments older than GlobalXmin can be truncated.
>
> It appears that this patch weakens the idea of hint bits. Even if
> HEAP_XMIN_COMMITTED is set, it still needs to find out if it's in the
> snapshot.
>
> That's fast if the xid is less than snap->xmin, but otherwise it needs
> to do a fetch from the csnlog, which is exactly what the hint bits are
> designed to avoid. And we can't get around this, because the whole point
> of this patch is to remove the xip array from the snapshot.

Yeah. This patch in the current state is likely much much slower than 
unpatched master, except in extreme cases where you have thousands of 
connections and short transactions so that without the patch, you spend 
most of the time acquiring snapshots.

My current thinking is that access to the csnlog will need to be made 
faster. Currently, it's just another SLRU, but I'm sure we can do better 
than that. Or add a backend-private cache on top of it; that might 
already alleviate it enough..

- Heikki



-- 
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 (113+ messages)  latest in thread

Message-ID: <53FC6545.7000501@vmware.com>
Permalink:  ../53FC6545.7000501@vmware.com/
Also on:    postgresql.org/message-id/53FC6545.7000501@vmware.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: hlinnakangas@vmware.com, pgsql@j-davis.com, stark@mit.edu, robertmhaas@gmail.com, andres@2ndquadrant.com, alvherre@2ndquadrant.com, bruce@momjian.us, rajeev.rastogi@huawei.com, ants@cybertec.at, markus@bluegap.ch
  Subject: Re: Proposal for CSN based snapshots
  In-Reply-To: <53FC6545.7000501@vmware.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