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

From Nick Wellnhofer
Subject Index not used with IS NULL
Date
Msg-id 3E3C34CC.60204@aevum.de
Whole thread Raw
Responses Re: Index not used with IS NULL
List pgsql-general
If I have a query like

SELECT * FROM table WHERE key IS NULL

and an index on column "key", a sequential scan is used. A query like

SELECT * FROM table WHERE key=123

uses an index scan. This is slowing down some queries in my current
project. Why aren't the NULL columns indexed? Is there a work-around?

Nick


pgsql-general by date:

Previous
From: "news.verizon.net"
Date:
Subject: Re: Problem starting a session
Next
From: Guy Fraser
Date:
Subject: Re: 2D arrays in 7.3... actually, parser bug?