Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

a few questions (and doubts) about xid



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



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group