postgresql/src/backend/rewrite
Tom Lane bedb78d386 Implement sharable row-level locks, and use them for foreign key references
to eliminate unnecessary deadlocks.  This commit adds SELECT ... FOR SHARE
paralleling SELECT ... FOR UPDATE.  The implementation uses a new SLRU
data structure (managed much like pg_subtrans) to represent multiple-
transaction-ID sets.  When more than one transaction is holding a shared
lock on a particular row, we create a MultiXactId representing that set
of transactions and store its ID in the row's XMAX.  This scheme allows
an effectively unlimited number of row locks, just as we did before,
while not costing any extra overhead except when a shared lock actually
has to be shared.   Still TODO: use the regular lock manager to control
the grant order when multiple backends are waiting for a row lock.

Alvaro Herrera and Tom Lane.
2005-04-28 21:47:18 +00:00
..
Makefile $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
rewriteDefine.c Completion of project to use fixed OIDs for all system catalogs and 2005-04-14 20:03:27 +00:00
rewriteHandler.c Implement sharable row-level locks, and use them for foreign key references 2005-04-28 21:47:18 +00:00
rewriteManip.c Make the behavior of HAVING without GROUP BY conform to the SQL spec. 2005-03-10 23:21:26 +00:00
rewriteRemove.c Completion of project to use fixed OIDs for all system catalogs and 2005-04-14 20:03:27 +00:00
rewriteSupport.c Completion of project to use fixed OIDs for all system catalogs and 2005-04-14 20:03:27 +00:00