Re: Remove xmin and cmin from frozen tuples

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>, ITAGAKI Takahiro <itagaki(dot)takahiro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove xmin and cmin from frozen tuples
Date: 2005-09-03 14:46:08
Message-ID: 200509031446.j83Ek8J11061@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Manfred Koizar wrote:
> On Fri, 2 Sep 2005 20:41:48 -0400 (EDT), Bruce Momjian
> <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> >> Once I had a patch based on 7.4 that stored cmin and cmax in
> >> backend-local memory.
>
> >Interesting idea, but how would you record the cmin/xmin values without
> >requiring unlimited memory?
>
> That's exactly the reason for not sending it to -patches. Without
> spilling to disk this is just not ready for real life. The problem is
> that -- unlike other data structures that build up during a
> transaction, e.g. trigger queues -- cmin/cmax lookup requires random
> access, so we'd need some form of tree or hash. Unfornunately I never
> got beyond brainstorming :-(

What we do for shared row locks is much more compact because we create a
phantom xid for combination of xids and store that in a hash. I think
the problem with having cmin/cmax in local memory is that without a way
to stamp a row with some fake cid (as is suggested in the TODO item now)
there is really no way to _group_ rows together to store their values as
a single item in local memory, meaning we would have to store ctids or
something for each row, and that seems unscalable.

I have added your memory-only idea to the TODO item because it
highlights that cmin/cmax is never looked at outside the backend that is
modifying the row.

If there was a tuple header field we can use just while the row is being
created or expired we could use that, but I don't see one. Could we
recalculated one of the fields after it is created/expired? I don't
know.

--
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 2005-09-03 14:48:00 Re: Adding a new node to the executor
Previous Message Alvaro Herrera 2005-09-03 14:09:08 Re: Adding a new node to the executor