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 C280B9FA5C8 for ; Mon, 5 Jun 2006 18:06:43 -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 76126-10 for ; Mon, 5 Jun 2006 18:06:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 9D5849FA30C for ; Mon, 5 Jun 2006 18:06:34 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k55L6V5O023916; Mon, 5 Jun 2006 17:06:31 -0400 (EDT) To: Andrew Sullivan cc: pgsql-performance@postgresql.org Subject: Re: Some queries starting to hang In-reply-to: <20060605203851.GB7071@phlogiston.dyndns.org> References: <1149534308.3583.56.camel@bg002441.pro-unlimited.com> <22706.1149538039@sss.pgh.pa.us> <20060605203851.GB7071@phlogiston.dyndns.org> Comments: In-reply-to Andrew Sullivan message dated "Mon, 05 Jun 2006 16:38:51 -0400" Date: Mon, 05 Jun 2006 17:06:31 -0400 Message-ID: <23915.1149541591@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/45 X-Sequence-Number: 19402 Andrew Sullivan writes: > On Mon, Jun 05, 2006 at 04:07:19PM -0400, Tom Lane wrote: >> I'm wondering about out-of-date or nonexistent ANALYZE stats, missing >> custom adjustments of statistics target settings, etc. > But even the nested loop shouldn't be a "never returns" case, should > it? For 1800 rows? 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). The hash plan will scale to larger numbers of rows much more gracefully than the nestloop ... regards, tom lane