X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7147BD1B8B7 for ; Thu, 4 Mar 2004 21:16:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48114-04 for ; Thu, 4 Mar 2004 17:15:54 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 724D2D1D0B6 for ; Thu, 4 Mar 2004 17:15:50 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i24LFo2T028775; Thu, 4 Mar 2004 16:15:50 -0500 (EST) To: Charles Hauser Cc: pgsql-sql@postgresql.org Subject: Re: query optimization In-reply-to: <1078422984.5001.18.camel@pandorina> References: <1078422984.5001.18.camel@pandorina> Comments: In-reply-to Charles Hauser message dated "04 Mar 2004 12:56:24 -0500" Date: Thu, 04 Mar 2004 16:15:50 -0500 Message-ID: <28774.1078434950@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/41 X-Sequence-Number: 17140 Charles Hauser writes: > I have the following query which is running quite slow on our server and > was hoping someone would have suggestions how I might improve it. Have you vacuumed or analyzed these tables recently? The EXPLAIN numbers show that the planner thinks all the tables are tiny, which hardly seems likely given that you're complaining about the speed. If it's still bad after you VACUUM ANALYZE, send EXPLAIN ANALYZE (not just EXPLAIN) output and maybe we can give some help. regards, tom lane