Обсуждение: NOT IN doesn't use index?

Поиск
Список
Период
Сортировка

NOT IN doesn't use index?

От
Becky Neville
Дата:
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


Re: NOT IN doesn't use index?

От
Andrew Sullivan
Дата:
On Sat, May 03, 2003 at 01:56:02AM -0400, Becky Neville wrote:
> Does the use of WHERE field  NOT IN ('A','B' etc) prevent the use of an
> index?

That '&c.' is hiding a lot.  Why not post your query and the explain
analyse output?

A
--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110