Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 45D1F636382 for ; Sun, 1 Mar 2009 13:05:59 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 69565-03 for ; Sun, 1 Mar 2009 13:05:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id F1E0263617E for ; Sun, 1 Mar 2009 13:05:54 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n21H5pX5012689; Sun, 1 Mar 2009 12:05:51 -0500 (EST) To: Brian Cox cc: "pgsql-performance@postgresql.org" Subject: Re: "slow" queries In-reply-to: <49A9F834.8060100@ca.com> References: <49A9F834.8060100@ca.com> Comments: In-reply-to Brian Cox message dated "Sat, 28 Feb 2009 18:51:32 -0800" Date: Sun, 01 Mar 2009 12:05:51 -0500 Message-ID: <12688.1235927151@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/1 X-Sequence-Number: 32923 Brian Cox writes: > Actually, they're all deadlocked. The question is why? Probably because the DROP is trying to acquire exclusive lock on its target table, and some other transaction already has a read or write lock on that table, and everything else is queuing up behind the DROP. It's not a true deadlock that is visible to the database, or else Postgres would have failed enough of the transactions to remove the deadlock. Rather, what you've got is some very-long-running transaction that is still making progress, or else is sitting idle because its client is neglecting to close it; and everything else is blocked behind that. If it is not clear to you exactly who is waiting for what, a look into the pg_locks view might help. regards, tom lane