a few questions (and doubts) about xid - Mailing list pgsql-general

From Luca Ferrari
Subject a few questions (and doubts) about xid
Date
Msg-id 200707241951.05907.fluca1978@infinito.it
Whole thread Raw
Responses Re: a few questions (and doubts) about xid  (Gregory Stark <stark@enterprisedb.com>)
Re: a few questions (and doubts) about xid  ("Simon Riggs" <simon@2ndquadrant.com>)
List 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

pgsql-general by date:

Previous
From: Chris
Date:
Subject: Re: about c# and postgresql
Next
From: "Albe Laurenz"
Date:
Subject: Re: ssl connections to postgresql