From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Nikolas Everett <nik9000@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Exhaustive list of what takes what locks
Date: Wed, 23 Feb 2011 12:31:19 -0500
Message-ID: <2316.1298482279@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTinf=fC9T8JJXsGMHDEggDNiXvj87opYfjO5huEq@mail.gmail.com>
References: <AANLkTiksaoSZ03m_jALCBwhfogZxNA5_wKo_3J6ydBfF@mail.gmail.com>
<20110202052004.GA26098@tornado.gateway.2wire.net>
<AANLkTikNzBfCQxsfed6qYTv0GrYZ8vM1wjwStjd8PwT=@mail.gmail.com>
<20110223042108.GA27781@tornado.gateway.2wire.net>
<AANLkTinf=fC9T8JJXsGMHDEggDNiXvj87opYfjO5huEq@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, noah@leadboat.com, nik9000@gmail.com
Subject: Re: Exhaustive list of what takes what locks
In-Reply-To: <2316.1298482279@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox