Re: Exhaustive list of what takes what locks - Mailing list pgsql-performance

From Tom Lane
Subject Re: Exhaustive list of what takes what locks
Date
Msg-id 2316.1298482279@sss.pgh.pa.us
Whole thread Raw
In response to Re: Exhaustive list of what takes what locks  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Exhaustive list of what takes what locks  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-performance
Robert Haas <robertmhaas@gmail.com> writes:
> ...but that begs the question of why DROP INDEX needs an
> AccessExclusiveLock.  It probably needs such a lock *on the index* but
> I don't see why we'd need it on the table.

Some other session might be in process of planning a query on the table.
It would be sad if the index it had chosen turned out to have vanished
meanwhile.  You could perhaps confine DROP INDEX's ex-lock to the index,
but only at the price of making the planner take out a lock on every
index it considers even transiently.  Which isn't going to be a net
improvement.

(While we're on the subject, I have strong suspicions that most of what
Simon did this cycle on ALTER TABLE lock strength reduction is
hopelessly broken and will have to be reverted.  It's on my to-do list
to try to break that patch during beta, and I expect to succeed.)

            regards, tom lane

pgsql-performance by date:

Previous
From: Robert Haas
Date:
Subject: Re: Exhaustive list of what takes what locks
Next
From: Robert Haas
Date:
Subject: Re: Exhaustive list of what takes what locks