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

From Bjørn T Johansen
Subject Re: Does not use index on query using "field is null"?
Date
Msg-id 20101110162149.16464645@pennywise.asp-as.no
Whole thread Raw
In response to Re: Does not use index on query using "field is null"?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, 10 Nov 2010 10:00:43 -0500
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> =?ISO-8859-1?Q?Bj=F8rn?= T Johansen <btj@havleik.no> writes:
> > 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?
>
> What PG version?  Releases before 8.3 do not think that IS NULL is an
> indexable condition.
>
>             regards, tom lane
>

We are using version 8.4.x...

BTJ

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Does not use index on query using "field is null"?
Next
From: Vibhor Kumar
Date:
Subject: Re: Comments on tables