Re: Index not used with IS NULL - Mailing list pgsql-general

From Tom Lane
Subject Re: Index not used with IS NULL
Date
Msg-id 15819.1044566327@sss.pgh.pa.us
Whole thread Raw
In response to Index not used with IS NULL  (Nick Wellnhofer <wellnhofer@aevum.de>)
Responses Re: Index not used with IS NULL  (Dima Tkach <dmitry@openratings.com>)
List pgsql-general
Nick Wellnhofer <wellnhofer@aevum.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

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: optimizer not eliminating redundant sorts
Next
From: "Fernando Papa"
Date:
Subject: Re: pg_temp schemas