Re: Nested transactions and tuple header info

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Manfred Koizar <mkoi-pg(at)aon(dot)at>, David Blasby <dblasby(at)refractions(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested transactions and tuple header info
Date: 2004-06-02 03:50:42
Message-ID: 20040602035042.GB2019@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 01, 2004 at 11:17:40PM -0400, Bruce Momjian wrote:

> Basically the phantom xid's are a shorthand for saying the tuple was
> created by xid1 and deleted by xid2, both part of the same main
> transaction.

Hmm... this would spread the ugliness elsewhere (hopefully only
HeapTupleHeaderGetXmin).

> A cursor looking at the rows has to recognize the xid is a phantom (via
> pg_subtrans) and look up the creation xid.

No need to look at pg_subtrans because we know all the Xids of our
transaction tree. I think this can be kept in local memory.

> Also, we will need a phantom xid for every xid1/xid2 pair. You can't
> just create one phantom xid per subtransaction because you must be able
> to control independently commit/rollback rows based on the status of the
> insert transaction.

Oh, sure. This could get huge pretty fast.

We still need to think on the effects this could have on crash recovery
though -- we'd have to write the phantom Xids to Xlog somehow
(indicating which ones are committed and which are aborted). And we
still don't know what effect it would have on CPU cost for every
visibility check.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Los dioses no protegen a los insensatos. Éstos reciben protección de
otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2004-06-02 03:53:39 Re: Why repalloc() != realloc() ?
Previous Message Bruce Momjian 2004-06-02 03:50:13 Re: Nested transactions and tuple header info