X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6D425D7282 for ; Thu, 24 Nov 2005 11:15:37 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49929-07 for ; Thu, 24 Nov 2005 15:15:40 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 841E3DBC1D for ; Thu, 24 Nov 2005 11:15:34 -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 jAOFFZYR013627; Thu, 24 Nov 2005 10:15:35 -0500 (EST) To: "Bealach-na Bo" cc: pgsql-performance@postgresql.org Subject: Re: Very slow queries - please help. In-reply-to: References: Comments: In-reply-to "Bealach-na Bo" message dated "Thu, 24 Nov 2005 13:06:48 +0000" Date: Thu, 24 Nov 2005 10:15:35 -0500 Message-ID: <13626.1132845335@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.005 required=5 tests=[AWL=0.005] X-Spam-Score: 0.005 X-Spam-Level: X-Archive-Number: 200511/496 X-Sequence-Number: 15753 "Bealach-na Bo" writes: > I'm having great difficulties getting the performance I had hoped for > from Postgresql 8.0. The typical query below takes ~20 minutes !! You need to show us the table definition (including indexes) and the EXPLAIN ANALYZE results for the query. It seems likely that the NOT IN is the source of your problems, but it's hard to be sure without EXPLAIN results. regards, tom lane