Re: Reducing relation locking overhead - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Reducing relation locking overhead
Date
Msg-id 10748.1134054315@sss.pgh.pa.us
Whole thread Raw
In response to Re: Reducing relation locking overhead  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Reducing relation locking overhead  (Csaba Nagy <nagy@ecircle-ag.com>)
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> Further thoughts:
> 1. Normally, we do not lock indexes via the LockMgrLock

> 2. When a REINDEX-like operation comes along, it first of all updates an
> MaintIntentLock flag on the index relation, which causes a relcache
> invalidation. It then waits until all backends have updated their
> relcache.

There isn't any way for it to do that (ie, be sure everyone else has
adjusted to the new state of affairs), short of acquiring some sort of
short-term exclusive lock on the table, which is a really bad idea.
The pending lock would block other incoming requests on the table until
all the current users exited their transactions.

I think the idea of not doing locking on indexes was pretty much shot
down in this thread, and we have to go looking for other solutions ...
thus my other proposal.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Vertical Partitioning with TOAST
Next
From: Tom Lane
Date:
Subject: Re: Reducing contention for the LockMgrLock