On Tue, Jun 28, 2011 at 1:47 PM, Kevin Grittner
<kevin.gritt...@wicourts.gov> wrote:
> (5)  When a heap scan is executed, there is no index gap to lock to
> cover the predicate involved, so we need to acquire a heap relation
> lock -- any insert to the relation by an overlapping transaction is a
> rw-conflict.  While these *look* just like tuple locks which got
> promoted, their purpose is entirely different.  Like index locks,
> they are for detecting inserts into the "gaps".  [Light bulb goes on
> over head: in some future release, perhaps it would be worth
> differentiating between the two uses of heap relation locks, to
> reduce the frequency of false positives.  A couple bit flags in the
> lock structure might do it.]

You know, it just occurred to me while reading this email that you're
using the term "predicate lock" in a way that is totally different
from what I learned in school.  What I was taught is that the word
"predicate" in "predicate lock" is like the word "tuple" in "tuple
lock" or the word "relation" in "relation lock" - that is, it
describes *the thing being locked*.  In other words, you are
essentially doing:

LOCK TABLE foo WHERE i = 1;

I think that what you're calling the predicate lock manager should
really be called the siread lock manager, and all of the places where
you are "predicate locking" a tuple should really be "siread locking"
the tuple.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to