pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: getting rid of SnapshotNow
Date: Tue, 23 Jul 2013 12:28:34 -0400
Message-ID: <2812.1374596914@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZ_q2KMkxZAoRxRHB7k1tOmjVjQgYt2JuA7=U7QZoLxNw@mail.gmail.com>
References: <CA+TgmoaLeu7wKtfPA0v=iQNMKOJZqg4TZf1Gyxn=7mbwa=Mxag@mail.gmail.com>
	<CA+TgmoZ_q2KMkxZAoRxRHB7k1tOmjVjQgYt2JuA7=U7QZoLxNw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas <robertmhaas@gmail.com> writes:
>> 2. snapshot-self-not-now-v1.patch changes several uses of SnapshotNow
>> to use SnapshotSelf instead.  These include pgrowlocks(),
>> pgstat_heap(), and get_actual_variable_range().

> Tom proposed that we use SnapshotDirty for this case; let me just ask
> whether there are any security concerns around that.  pgstattuple only
> displays aggregate information so I think that's OK, but I wonder if
> the value found in get_actual_variable_range() can leak out in EXPLAIN
> output or whatever.  I can't particularly think of any reason why that
> would actually matter, but I've generally shied away from exposing
> data written by uncommitted transactions, and this would be a step in
> the other direction.  Does this worry anyone else or am I being
> paranoid?

As far as get_actual_variable_range() is concerned, an MVCC snapshot
would probably be the thing to use anyway; I see no need for the planner
to be using estimates that are "more up to date" than that.  pgrowlocks
and pgstat_heap() might be in a different category.

> But thinking about it a little more, I wonder why
> get_actual_variable_range() is using a snapshot at all.  Presumably
> what we want there is to find the last index key, regardless of the
> visibility of the heap tuple to which it points.

No, what we ideally want is to know the current variable range that
would be seen by the query being planned.

			regards, tom lane


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

Message-ID: <2812.1374596914@sss.pgh.pa.us>
Permalink:  ../2812.1374596914@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2812.1374596914@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-odbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: getting rid of SnapshotNow
  In-Reply-To: <2812.1374596914@sss.pgh.pa.us>
  References: <CA+TgmoaLeu7wKtfPA0v=iQNMKOJZqg4TZf1Gyxn=7mbwa=Mxag@mail.gmail.com> <CA+TgmoZ_q2KMkxZAoRxRHB7k1tOmjVjQgYt2JuA7=U7QZoLxNw@mail.gmail.com> <2812.1374596914@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