Re: Reducing overhead of frequent table locks - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Reducing overhead of frequent table locks
Date
Msg-id 5273.1306334124@sss.pgh.pa.us
Whole thread Raw
In response to Re: Reducing overhead of frequent table locks  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Reducing overhead of frequent table locks  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> On Wed, May 25, 2011 at 1:44 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Wed, May 25, 2011 at 8:27 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
>>> Design seemed relatively easy from there: put local lock table in
>>> shared memory for all procs. We then have a use_strong_lock at proc
>>> and at transaction level. Anybody that wants a strong lock first sets
>>> use_strong_lock at proc and transaction level, then copies all local
>>> lock data into shared lock table,

>> I'm not following this...

> Which bit aren't you following? It's a design outline for how to
> implement, deliberately brief to allow a discussion of design
> alternatives.

What I'm not following is how moving the local lock table into shared
memory can possibly be a good idea.  The reason we invented the local
lock table in the first place (we didn't use to have one) is so that a
process could do some manipulations without touching shared memory.
(Notably, it is currently nearly free, and certainly lock-free, to
re-request a lock type you already hold.  This is not an infrequent
case.)  That advantage will go away if you do this.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Volunteering as Commitfest Manager
Next
From: Hitoshi Harada
Date:
Subject: Re: Pull up aggregate subquery