X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3B8A3D1B4B0 for ; Mon, 15 Dec 2003 19:29:28 +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 00257-03 for ; Mon, 15 Dec 2003 15:29:03 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 1C115D1B478 for ; Mon, 15 Dec 2003 15:28:56 -0400 (AST) Received: (qmail 25049 invoked by uid 500); 15 Dec 2003 19:28:47 -0000 Date: Mon, 15 Dec 2003 13:28:47 -0600 From: Bruno Wolff III To: Prashant Dalal Cc: pgsql-sql@postgresql.org Subject: Re: NOT-IN CLAUSE Message-ID: <20031215192847.GA24755@wolff.to> Mail-Followup-To: Prashant Dalal , pgsql-sql@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/108 X-Sequence-Number: 16274 On Mon, Dec 15, 2003 at 12:14:17 -0500, Prashant Dalal wrote: > Hi, > > My Following select st. is running from last one day. I think the problem is > NOT IN clause. > Please suggest the alternative select clause. NOT IN was especially slow up until Postgres 7.4. If using 7.4 is a problem you can rewrite your query to use NOT EXISTS.