a few questions (and doubts) about xid

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: a few questions (and doubts) about xid
Date: 2007-07-24 17:51:05
Message-ID: 200707241951.05907.fluca1978@infinito.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

HI all,
apologize me for my stupid questions but I'd like to better understand how
mvcc works. Now, each tuple has xmin (insert xid) and xmax (delete/update
xid). In short each transaction with xmin<=xid<=xmax can see such tuple,
otherwise it cannot (of course beeing xmin and xmax different transtaction
from xid and beeing committed), isn't it?

Now, for subtrans the xid is laizyly obtained, due to efficiency purposes. But
in such way subtrans xid should be greater than each other xid of concurrent
(main) transactions. If the subtrans inserts a record is the subtrans xid
placed in xmin? Because in this case the xmin value makes the tuple invisible
to every other concurrent transaction started with the parent one. Is this
true or do the subtrans commit with the parent xid (in this case why the
subtrans should have a xid?)? Ok, I'm bit confused here....

Finally, the pg_class.relfrozenxid should not be set to the frozen value
specified in transam.h when vacuum is executed? And what is its meaning for a
newly created table (I see a value that I cannot understand)?

Thanks,
Luca

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2007-07-24 18:41:34 Re: Best interval timeout and check interval for Slony
Previous Message Gautam Sampathkumar 2007-07-24 17:47:44 Porting MySQL data types to PostgreSQL