X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 13C139FB1B9 for ; Tue, 6 Jun 2006 14:54:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 33896-09 for ; Tue, 6 Jun 2006 14:54:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 5B2239FA13E for ; Tue, 6 Jun 2006 14:54:29 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Tue, 6 Jun 2006 17:54:27 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 06 Jun 2006 12:54:27 -0500 Subject: Re: Some queries starting to hang From: Scott Marlowe To: "Craig A. James" Cc: pgsql-performance@postgresql.org In-Reply-To: <4485C061.2080206@modgraph-usa.com> References: <1149534308.3583.56.camel@bg002441.pro-unlimited.com> <22706.1149538039@sss.pgh.pa.us> <20060605203851.GB7071@phlogiston.dyndns.org> <23915.1149541591@sss.pgh.pa.us> <1149604741.2621.487.camel@localhost.localdomain> <17148.1149605005@sss.pgh.pa.us> <1149605576.2621.502.camel@localhost.localdomain> <17426.1149606369@sss.pgh.pa.us> <4485C061.2080206@modgraph-usa.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1149616467.25526.213.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 06 Jun 2006 12:54:27 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/66 X-Sequence-Number: 19423 On Tue, 2006-06-06 at 12:50, Craig A. James wrote: > Tom Lane wrote: > >>The idea I just had was: why do we need EXPLAIN ANALYZE to run to > >>completion? In severe cases like this thread, we might be able to > >>discover the root cause by a *partial* execution of the plan, as long as > >>it was properly instrumented. That way, the OP might have been able to > >>discover the root cause himself... > > > > > > I don't think that helps, as it just replaces one uncertainty by > > another: how far did the EXPLAIN really get towards completion of the > > plan? You still don't have any hard data. > > But at least you have some data, which is better than no data. Even knowing that the plan got stuck on a particular node of the query plan could be vital information. For a query that never finishes, you can't even find out where it's getting stuck. > > That's why Simon's proposal might help in some particularly difficult situations. Hmmmmm. I wonder if it be hard to have explain analyze have a timeout per node qualifier? Something that said if it takes more than x milliseconds for a node to kill the explain analyze and list the up to the nasty node that's using all the time up? That would be extremely useful.