Re: [HACKERS] postgres inode q's - Mailing list pgsql-hackers

From Bernard Frankpitt
Subject Re: [HACKERS] postgres inode q's
Date
Msg-id 3811F51C.B884AC7D@pop.dn.net
Whole thread Raw
In response to Re: [HACKERS] postgres inode q's  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 
> ................ So, as soon as any backend
> checks a tuple and sees that its inserting transaction did commit,
> it rewrites the tuple with a new state "INSERT KNOWN COMMITTED" (which
> is represented by inserting XID = 0 or some such). .........
> 

The way concurrency is supported in PostgreSQL is really cool, and I
think not widely understood. The tuple uses flags stored in the
t_infomask field of the HeapTupleHeader structure to 'cache' the status
of the creating and deleting transactions for each tuple. 

Check out backend/utils/time/tqual.c  and  include/utils/tqual.h  for
the details of the algorithms.  (Not recommended if you have been
drinking at all)

Ullman "Principles of Database and Knowledge-Base Systems, Vol 1" Has a
pretty good discussion of time based and lock based schemes for
concurrency control.
Bernie Frankpitt


pgsql-hackers by date:

Previous
From: Oleg Broytmann
Date:
Subject: GPL vs BSD vs SCSL
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] RFC: Industrial-strength logging (long message)