Index not used with IS NULL

From: Nick Wellnhofer <wellnhofer(at)aevum(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Index not used with IS NULL
Date: 2003-02-01 20:57:48
Message-ID: 3E3C34CC.60204@aevum.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message news.verizon.net 2003-02-02 00:05:55 Re: Problem starting a session
Previous Message will trillich 2003-02-01 19:57:23 Re: paradigm sanity check needed [long]