From: Martijn van Oosterhout <kleptog@svana.org>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PFC <lists@peufeu.com>
Cc: Mitchell Skinner <mitch@arctur.us>
Cc: pgsql-performance@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Big IN() clauses etc : feature proposal
Date: Thu, 11 May 2006 20:03:19 +0200
Message-ID: <20060511180319.GK30113@svana.org> (raw)
In-Reply-To: <20060511171806.GJ99570@pervasive.com>
References: <20060509113337.M90693@vesihiisi.cksoft.de>
<op.s893vzcpcigqcu@apollo13>
<20060509103632.GD29652@svana.org>
<op.s897j60qcigqcu@apollo13>
<1147190285.32304.43.camel@firebolt>
<op.s9alu1vhcigqcu@apollo13>
<16680.1147201981@sss.pgh.pa.us>
<20060510190011.GO99570@pervasive.com>
<22558.1147307514@sss.pgh.pa.us>
<20060511171806.GJ99570@pervasive.com>
On Thu, May 11, 2006 at 12:18:06PM -0500, Jim C. Nasby wrote:
> > Yes, because there can be more than one active snapshot within a single
> > transaction (think about volatile functions in particular).
>
> Any documentation on how snapshot's work? They're a big mystery to me.
> :(
A snapshot is a particular view on a database. In particular, you have
to be able to view a version of the database that doesn't have you own
changes, otherwise an UPDATE would keep updating the same tuple. Also,
for example, a cursor might see an older version of the database than
queries being run. I don't know of any particular information about it
though. Google wasn't that helpful.
> > No; you forgot about subtransactions.
>
> Oh, I thought those were done with cmin and cmax... if that's not what
> cmin/cmax are for, then what is?
cmin/cmax are command counters. So in the sequence:
BEGIN;
SELECT 1;
SELECT 2;
The second query runs as the same transaction ID but a higher command
ID so it can see the result of the previous query. Subtransactions are
(AIUI anyway) done by having transactions depend on other transactions.
When you start a savepoint you start a new transaction ID whose status
is tied to its top-level transaction ID but can also be individually
rolledback.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/> From each according to his ability. To each according to his ability to litigate.
Attachments:
signature.asc (application/pgp-signature, 188B) download
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-performance@postgresql.org
Cc: kleptog@svana.org, jnasby@pervasive.com, tgl@sss.pgh.pa.us, lists@peufeu.com, mitch@arctur.us, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Big IN() clauses etc : feature proposal
In-Reply-To: <20060511180319.GK30113@svana.org>
* 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