Does not use index on query using "field is null"? - Mailing list pgsql-general

From Bjørn T Johansen
Subject Does not use index on query using "field is null"?
Date
Msg-id 20101110130749.14dff805@pennywise.asp-as.no
Whole thread Raw
Responses Re: Does not use index on query using "field is null"?  (Vick Khera <vivek@khera.org>)
Re: Does not use index on query using "field is null"?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I have a query that looks like this...:

select * from table where field is null

And when I run explain, it tells me that it uses seq scan... Is this because pg thinks that seq scan is as fast as
usingindexes or because using index on "is null" queries does 
not work?


Regards,

BTJ

--
-----------------------------------------------------------------------------------------------
Bjørn T Johansen

btj@havleik.no
-----------------------------------------------------------------------------------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
-----------------------------------------------------------------------------------------------

pgsql-general by date:

Previous
From: Szymon Guz
Date:
Subject: Re: Comments on tables
Next
From: Vick Khera
Date:
Subject: Re: Does not use index on query using "field is null"?