Re: Nested transactions and tuple header info - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Nested transactions and tuple header info
Date
Msg-id 20040602035042.GB2019@dcc.uchile.cl
Whole thread Raw
In response to Re: Nested transactions and tuple header info  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Nested transactions and tuple header info
List 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)



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Nested transactions and tuple header info
Next
From: Alvaro Herrera
Date:
Subject: Re: Why repalloc() != realloc() ?