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 2AE799FA2E6 for ; Tue, 6 Jun 2006 11:53:14 -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 05296-02 for ; Tue, 6 Jun 2006 11:53:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sand3.gxn.net (sand3.gxn.net [195.147.249.238]) by postgresql.org (Postfix) with ESMTP id 1FE529F9316 for ; Tue, 6 Jun 2006 11:53:05 -0300 (ADT) Received: from [62.232.55.118] (helo=[192.168.0.2]) by sand3.gxn.net with esmtp (Exim 4.50) id 1FncwX-00053t-1C; Tue, 06 Jun 2006 15:54:05 +0100 Subject: Re: Some queries starting to hang From: Simon Riggs To: Tom Lane Cc: Andrew Sullivan , pgsql-performance@postgresql.org In-Reply-To: <17148.1149605005@sss.pgh.pa.us> 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> Content-Type: text/plain Date: Tue, 06 Jun 2006 15:52:56 +0100 Message-Id: <1149605576.2621.502.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 (2.6.1-1.fc5.2) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/54 X-Sequence-Number: 19411 On Tue, 2006-06-06 at 10:43 -0400, Tom Lane wrote: > Simon Riggs writes: > > On Mon, 2006-06-05 at 17:06 -0400, Tom Lane wrote: > >> Well, it's a big query. If it ought to take a second or two, and > >> instead is taking an hour or two (1800 times the expected runtime), that > >> might be close enough to "never" to exhaust Chris' patience. Besides, > >> we don't know whether the 1800 might itself be an underestimate (too bad > >> Chris didn't provide EXPLAIN ANALYZE results). > > > This is a good example of a case where the inefficiency of EXPLAIN > > ANALYZE would be a contributory factor to it not actually being > > available for diagnosing a problem. > > Huh? The problem is the inefficiency of the underlying query. Of course that was the main problem from the OP. You mentioned it would be good if the OP had delivered an EXPLAIN ANALYZE; I agree(d). The lack of EXPLAIN ANALYZE is frequently because you can't get them to run to completion - more so when the query you wish to analyze doesn't appear to complete either. 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... -- Simon Riggs EnterpriseDB http://www.enterprisedb.com