X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1EC20D1B51C for ; Thu, 13 Nov 2003 14:57:54 +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 51627-04 for ; Thu, 13 Nov 2003 10:57:26 -0400 (AST) Received: from candle.pha.pa.us (unknown [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id D6FF1D1B515 for ; Thu, 13 Nov 2003 10:57:20 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id hADEuv409079; Thu, 13 Nov 2003 09:56:57 -0500 (EST) From: Bruce Momjian Message-Id: <200311131456.hADEuv409079@candle.pha.pa.us> Subject: Re: IN surpasses NOT EXISTS in 7.4RC2 ?? In-Reply-To: <200311131323.39762.mallah@trade-india.com> To: Rajesh Kumar Mallah Date: Thu, 13 Nov 2003 09:56:57 -0500 (EST) Cc: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/88 X-Sequence-Number: 4648 Rajesh Kumar Mallah wrote: > > Hi, > > NOT EXISTS is taking almost double time than NOT IN . > I know IN has been optimised in 7.4 but is anything > wrong with the NOT EXISTS? > > I have vaccumed , analyze and run the query many times > still not in is faster than exists :> Seems fine. In 7.4, NOT IN will often be faster that NOT EXISTS. NOT EXISTS didn't change --- there are restrictions on how far we can optimize NOT EXISTS. NOT IN has just become much faster in 7.4. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073