pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tomas Vondra <tv@fuzzy.cz>
Cc: Thom Brown <thom@linux.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: change in LOCK behavior
Date: Thu, 11 Oct 2012 13:22:42 -0400
Message-ID: <21922.1349976162@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+U5nMJhhTG8i41c4HNcHJYcD=m8xdem=6tPFhUDMv6niy1Gkg@mail.gmail.com>
References: <5075D8DF.6050500@fuzzy.cz>
	<CAA-aLv4PF-gM6mt4ZP4GnKGkZE1fheVeUC=8jQCgzvWbaA8+mQ@mail.gmail.com>
	<5075DFC2.9090306@fuzzy.cz>
	<12761.1349910622@sss.pgh.pa.us>
	<CA+TgmoZjLV2J44-WD5w0VhuXoPzfaY7_p5nTi6y73w9898-vMA@mail.gmail.com>
	<14951.1349916214@sss.pgh.pa.us>
	<CA+U5nMJaNqPNWcaD+T03FgD_USM7k5YGh2zsFn7pprVJLRjJbA@mail.gmail.com>
	<19901.1349974420@sss.pgh.pa.us>
	<CA+U5nMJhhTG8i41c4HNcHJYcD=m8xdem=6tPFhUDMv6niy1Gkg@mail.gmail.com>

Simon Riggs <simon@2ndQuadrant.com> writes:
> On 11 October 2012 17:53, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Maybe what we really need is to find a way to make taking a snapshot a
>> lot cheaper, such that the whole need for this patch goes away.  We're
>> not going to get far with the idea of making SnapshotNow MVCC-safe
>> unless it becomes a lot cheaper to get an MVCC snapshot.  I recall some
>> discussion of trying to reduce a snapshot to a WAL offset --- did that
>> idea crash and burn, or is it still viable?

> I think that is still at the "fond wish" stage and definitely not
> backpatchable in this universe.

Of course not.  This performance improvement is simply lost for 9.2.
We can try to do better in future releases, but it's a failed experiment
for now.  Life is hard :-(

> I suggested a way to automatically trigger a second snapshot. I think
> that would be acceptable to backpatch.

If it worked, I might be amenable to that, but it doesn't.  You can't
trigger taking a new snapshot off whether we waited for a lock; that
still has race conditions, just ones that are not so trivial to
demonstrate manually.  (The other transaction might have committed
microseconds before you reach the point of waiting for the lock.)
It would have to be a rule like "take a new snapshot if we acquired
any new lock since the previous snapshot".  While that would work,
we'd end up with no performance gain worth mentioning, since there
would almost always be some lock acquisitions during parsing.

			regards, tom lane




view thread (38+ messages)  latest in thread

Message-ID: <21922.1349976162@sss.pgh.pa.us>
Permalink:  ../21922.1349976162@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21922.1349976162@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, simon@2ndQuadrant.com, robertmhaas@gmail.com, tv@fuzzy.cz, thom@linux.com
  Subject: Re: change in LOCK behavior
  In-Reply-To: <21922.1349976162@sss.pgh.pa.us>
  References: <5075D8DF.6050500@fuzzy.cz> <CAA-aLv4PF-gM6mt4ZP4GnKGkZE1fheVeUC=8jQCgzvWbaA8+mQ@mail.gmail.com> <5075DFC2.9090306@fuzzy.cz> <12761.1349910622@sss.pgh.pa.us> <CA+TgmoZjLV2J44-WD5w0VhuXoPzfaY7_p5nTi6y73w9898-vMA@mail.gmail.com> <14951.1349916214@sss.pgh.pa.us> <CA+U5nMJaNqPNWcaD+T03FgD_USM7k5YGh2zsFn7pprVJLRjJbA@mail.gmail.com> <19901.1349974420@sss.pgh.pa.us> <CA+U5nMJhhTG8i41c4HNcHJYcD=m8xdem=6tPFhUDMv6niy1Gkg@mail.gmail.com> <21922.1349976162@sss.pgh.pa.us>

* 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