From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com> |
Cc: | Vlad Krupin <vlad(at)echospace(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: 'DROP INDEX' kills stored rpocedures |
Date: | 2003-04-03 20:36:03 |
Message-ID: | 12966.1049402163@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"scott.marlowe" <scott(dot)marlowe(at)ihs(dot)com> writes:
> On Thu, 3 Apr 2003, Vlad Krupin wrote:
>> consider this sequence of commands:
>>
>> #1 BEGIN;
>> #2 BEGIN;
>> #2 DROP INDEX "bar_idx";
>> #1 EXPLAIN ANALYZE SELECT * FROM "foo" WHERE "bar"='hello';
>>
>> This performs a sequential scan for me, even though I have not committed
>> the transaction on client #2 yet! If I do not drop the index (no #2
>> statements), it performes an indexed scan.
> On my 7.2.x box, this results in #1 waiting for #2 to commit. It just
> pauses #1 indefinitely. Are you running 7.3.x? Might explain the
> differences.
I overlooked this part of Vlad's message. AFAIK the above should cause #1
to wait for #2's commit in *any* version of Postgres; certainly anything
released in the last several years. DROP INDEX will take an exclusive
lock on the table owning the index, and that will prevent EXPLAIN from
accessing the table even just to plan a query on it.
[ thinks... ] Um, Scott and I are both assuming that bar_idx is indeed
an index on table foo. Perhaps this was just pilot error about what
index belonged to what table?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Bruno Wolff III | 2003-04-03 20:40:42 | Re: Rules, Triggers something more challenging |
Previous Message | Network Administrator | 2003-04-03 20:32:55 | Re: Multiple References on one Foreign Key |