Re: SSI modularity questions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: SSI modularity questions
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: SSI modularity questions  ("Kevin Grittner" <[email protected]>)
Responses Re: SSI modularity questions
List pgsql-hackers
On Tue, Jun 28, 2011 at 1:47 PM, Kevin Grittner
<[email protected]> 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


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: SSI modularity questions
Next
From: Florian Pflug
Date:
Subject: Re: spinlock contention