Re: Nested transactions and tuple header info

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, 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 16:23:37
Message-ID: 200406021623.i52GNbR29250@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I don't understand why a single counter is needed for phantom xids. We
> > keep the cmin/cmax on the tuple already, and our own backend can look up
> > the xmin/xmax that goes with the phantom.
>
> Oh, so you're thinking of an internal table that provides a mapping back
> to the replaced xmin? Ugh. Perhaps it could be made to work, but it's
> a lot of mechanism, and it will slow down visibility checks (since
> AFAICS you'd have to check every subxid against the phantoms table).

My idea was to have a tuple bit indicating the xid is a phantom.

> If we go with a global CID counter then we don't have to add that step.

Seems Alvaro is already using a global counter.

> A global CID counter would also simplify other visibility tests. Alvaro
> hasn't said anything about how he's doing visibility checks across
> different subxacts of the same main xact, but without global CID there
> would need to be some pretty ugly checks to determine whether a subxact
> happened before or after the CID cutoff your outer xact is interested
> in.

If a global counter will reduce the number of phantom checks, then good.
However, I assume Alvaro has to access the creation/expire xid to
determine if the subtransaction committed, so I didn't think a global
counter would help reduce the number of lookups.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2004-06-02 16:46:37 Re: Nested transactions and tuple header info
Previous Message Alvaro Herrera 2004-06-02 15:47:33 Re: Nested transactions and tuple header info