NOT IN doesn't use index?

From: Becky Neville <rebecca(dot)neville(at)yale(dot)edu>
To: pgsql-performance(at)postgresql(dot)org
Subject: NOT IN doesn't use index?
Date: 2003-05-03 05:56:02
Message-ID: Pine.LNX.4.44.0305030153230.2047-100000@termite.zoo.cs.yale.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I have been looking through the archives but can't find anything on this.

Does the use of WHERE field NOT IN ('A','B' etc) prevent the use of an
index?
Would changing the query to WHERE field <> 'A' and field <> 'B' etc help?

The query only involves one table, and this is the only field in the where
clause. Explain plan indicates a Sort and Seq Scan are being done.

THanks

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2003-05-03 07:57:54 Re: Looking for a cheap upgrade (RAID)
Previous Message Antoine 2003-05-03 05:52:41 looking for large dataset