Re: New lock types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: New lock types
Date
Msg-id 12139.1033937326@sss.pgh.pa.us
Whole thread Raw
In response to Re: New lock types  (Alvaro Herrera <alvherre@atentus.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@atentus.com> writes:
> I think creating a new LWLockId (BTFreeListLock?) can help here.  The
> operations on freelist are short lived and rather infrequent so it
> doesn't seem to matter that it is global to all indexes.

Seems like a really bad idea to me ... what makes you think that this
would not be a bottleneck?  You'd have to take such a lock during every
index-page split, which is not that uncommon.

> Another way
> would be to create one LockId per index, but it seems a waste to me.

No, you should be looking at a way to represent index locking in the
standard lock manager, not as an LWLock.  We've already got a concept
of page-level lockable entities there.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Copeland
Date:
Subject: Re: Proposed LogWriter Scheme, WAS: Potential Large
Next
From: Alvaro Herrera
Date:
Subject: Naming convention