Re: Index not used with IS NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nick Wellnhofer <wellnhofer(at)aevum(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Index not used with IS NULL
Date: 2003-02-06 21:18:47
Message-ID: 15819.1044566327@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nick Wellnhofer <wellnhofer(at)aevum(dot)de> writes:
> If I have a query like
> SELECT * FROM table WHERE key IS NULL
> and an index on column "key", a sequential scan is used.

IS NULL is not an indexable operator.

I suggest reconsidering your data representation, as this is unlikely to
change soon...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Papa 2003-02-06 21:21:13 Re: pg_temp schemas
Previous Message Greg Stark 2003-02-06 21:17:15 optimizer not eliminating redundant sorts