Re: cheaper snapshots redux - Mailing list pgsql-hackers

From Robert Haas
Subject Re: cheaper snapshots redux
Date
Msg-id CA+TgmoZWfis65Sx4CX+qOUrFhQdrx9sfNgcqmrYLagw3H5yUPw@mail.gmail.com
Whole thread Raw
In response to Re: cheaper snapshots redux  (Markus Wanner <markus@bluegap.ch>)
Responses Re: cheaper snapshots redux
List pgsql-hackers
On Wed, Aug 24, 2011 at 4:30 AM, Markus Wanner <markus@bluegap.ch> wrote:
> I'm in respectful disagreement regarding the ring-buffer approach and
> think that dynamic allocation can actually be more efficient if done
> properly, because there doesn't need to be head and tail pointers, which
> might turn into a point of contention.

True; although there are some other complications.  With a
sufficiently sophisticated allocator you can avoid mutex contention
when allocating chunks, but then you have to store a pointer to the
chunk somewhere or other, and that then requires some kind of
synchronization.

> As a side note: that I've been there with imessages.  Those were first
> organized as a ring-bufffer.  The major problem with that approach was
> the imessages were consumed with varying delay.  In case an imessage was
> left there for a longer amount of time, it blocked creation of new
> imessages, because the ring-buffer cycled around once and its head
> arrived back at the unconsumed imessage.
>
> IIUC (which might not be the case) the same issue applies for snapshots.

One difference with snapshots is that only the latest snapshot is of
any interest.

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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: skip WAL on COPY patch
Next
From: Markus Wanner
Date:
Subject: Re: cheaper snapshots redux