Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 88CA12E3311 for ; Thu, 10 Jan 2008 17:47:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 13319-10 for ; Thu, 10 Jan 2008 17:47:48 -0400 (AST) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by postgresql.org (Postfix) with ESMTP id 9BBBB2E00D5 for ; Thu, 10 Jan 2008 17:47:48 -0400 (AST) X-EthosMedia-Virus-Scanned: no infections found Received: from [64.81.245.111] (account josh@agliodbs.com HELO [192.168.1.27]) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 14734033; Thu, 10 Jan 2008 13:52:30 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: not exists clause Date: Thu, 10 Jan 2008 13:50:30 -0800 User-Agent: KMail/1.8 Cc: "S Golly" References: <4a5f56930801101215l5ae2d5bdk2db4f1873e0789ca@mail.gmail.com> In-Reply-To: <4a5f56930801101215l5ae2d5bdk2db4f1873e0789ca@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801101350.33211.josh@agliodbs.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/57 X-Sequence-Number: 28296 Golly, > I cannot get the "not exists" clause of ANSI SQL to execute correctly. > select t.col11, t.col1... from table1 t where not exists (select 1 from > table2 where col2 = t.col1); > table1 has 40M + rows. if that matters. > > OS is FreeBSD 6.2, postgresql version 8.2.6 You'll have to post the actual query and error message. WHERE NOT EXISTS has been supported since version 7.1. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco