From: Robert Haas <robertmhaas@gmail.com>
To: Brian Cox <brian.cox@ca.com>
Cc: Tom Lane [tgl@sss.pgh.pa.us] <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: "slow" queries
Date: Mon, 2 Mar 2009 14:04:34 -0500
Message-ID: <603c8f070903021104nda49e5ay4cbcb75a3a7ce7f4@mail.gmail.com> (raw)
In-Reply-To: <49AC23FF.9070103@ca.com>
References: <49AC23FF.9070103@ca.com>
On Mon, Mar 2, 2009 at 1:22 PM, Brian Cox <brian.cox@ca.com> wrote:
> As you can see there are only 3 transactions and 1 starts 1 hour after
> the drop begins. I'm still trying to figure out how to interpret the
> pg_locks output, but (presumably) you/others on this forum have more
> experience at this than I.
I'm rather suspicious of that line that says <IDLE> in transaction.
Connections that are idle, but in a transaction, can be holding locks.
And since they are idle, things can stay that way for a very long
time... hours, days... coincidentally, that idle-in-transaction
procpid is holding AccessShareLocks on a whole boatload of relations.
It's a little hard to decode this output because the "relation" column
from pg_locks is an OID, and we don't know what relation it
represents. It's helpful to cast that column to "regclass": select
locktype,database,relation::regclass,virtualxid,virtualtransaction,pid,mode
from pg_locks order by mode;
For now, though, try this:
select oid, relname from pg_class where relname like 'ts_defects%';
I suspect you'll find that the oid of the table that you were trying
to drop is one of the ones on which the idle in transaction process is
holding an AccessShareLock on...
...Robert
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: robertmhaas@gmail.com, brian.cox@ca.com, tgl@sss.pgh.pa.us
Subject: Re: "slow" queries
In-Reply-To: <603c8f070903021104nda49e5ay4cbcb75a3a7ce7f4@mail.gmail.com>
References: <49AC23FF.9070103@ca.com> <603c8f070903021104nda49e5ay4cbcb75a3a7ce7f4@mail.gmail.com>
* 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