Re: Multiple Xids in PGPROC?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multiple Xids in PGPROC?
Date: 2004-05-06 02:49:45
Message-ID: 200405060249.i462nj810260@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Manfred Koizar wrote:
> With subtransactions we'd have to fall back to checking pg_clog (and
> pg_subtrans) in certain cases. There are lots of possible
> implementations. Here are some ideas (just brainstorming):
>
> . We could first scan the PGPROC array. If the xid is an active main
> transaction, we're finished.
>
> . If xid is older than RecentGlobalXmin, it cannot be active.
>
> . We could include a small number of subtransaction xids in PGPROC.
>
> . For additional subtransactions not fitting into this small array
> there could be minsubxid and maxsubxid fields in PGPROC. If the xid we
> are looking for is outside all these ranges, it cannot be an active
> subtransaction.
>
> . If all these tests fail, we fall back to checking pg_clog.

Could we add a boolean to each PROC structure indicating if that xid has
subtransactions? If none have subtransactions, we don't need to look in
pg_clog.

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-05-06 03:00:29 Re: ALTER TABLE TODO items
Previous Message Bruce Momjian 2004-05-06 02:39:04 Re: Multiple Xids in PGPROC?