X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0A994476237 for ; Sat, 3 May 2003 14:35:58 -0400 (EDT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 543D3475B99 for ; Sat, 3 May 2003 14:35:52 -0400 (EDT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3006027; Sat, 03 May 2003 11:35:17 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Becky Neville , andrew@libertyrms.info Subject: Re: NOT IN doesn't use index? (fwd) Date: Sat, 3 May 2003 11:34:40 -0700 User-Agent: KMail/1.4.3 Cc: pgsql-performance@postgresql.org References: In-Reply-To: MIME-Version: 1.0 Message-Id: <200305031134.40508.josh@agliodbs.com> Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-31.1 required=5.0 tests=BAYES_01,IN_REP_TO,NO_DNS_FOR_FROM,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/27 X-Sequence-Number: 1806 Becky, > Here is the EXPLAIN output from the two queries. The first is the one > that uses WHERE field NOT IN ( 'a','b' etc ). The second is the (much > faster) one > that uses WHERE NOT (field =3D 'a' and field =3D 'b' etc). We still can't help you if you're not posting your actual queries. We have= no=20 idea what's in query3.sql. We're not clairvoyant, y'know. --=20 Josh Berkus Aglio Database Solutions San Francisco