X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B746F9DC802 for ; Fri, 6 Jan 2006 01:08:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98037-07 for ; Fri, 6 Jan 2006 01:08:00 -0400 (AST) 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 252029DCB61 for ; Fri, 6 Jan 2006 01:07:58 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k0657vcx018084; Fri, 6 Jan 2006 00:07:57 -0500 (EST) To: Patrick Hatcher cc: pgsql-performance@postgresql.org Subject: Re: Slow query. Any way to speed up? In-reply-to: References: Comments: In-reply-to Patrick Hatcher message dated "Thu, 05 Jan 2006 16:38:17 -0800" Date: Fri, 06 Jan 2006 00:07:57 -0500 Message-ID: <18083.1136524077@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.07 required=5 tests=[AWL=0.070] X-Spam-Score: 0.07 X-Spam-Level: X-Archive-Number: 200601/31 X-Sequence-Number: 16509 Patrick Hatcher writes: > The following SQL takes 4+ mins to run. I have indexes on all join fields > and I've tried rearranging the table orders but haven't had any luck. Please show EXPLAIN ANALYZE output, not just EXPLAIN. It's impossible to tell whether the planner is making any wrong guesses when you can't see the actual times/rowcounts ... (BTW, 7.4 is looking pretty long in the tooth.) regards, tom lane