Re: Using index for IS NULL query - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: Using index for IS NULL query
Date
Msg-id dcc563d10811111534x3957273aw8365cb497cc0c91c@mail.gmail.com
Whole thread Raw
In response to Re: Using index for IS NULL query  ("Vladimir Sitnikov" <sitnikov.vladimir@gmail.com>)
List pgsql-performance
On Tue, Nov 11, 2008 at 4:00 PM, Vladimir Sitnikov
<sitnikov.vladimir@gmail.com> wrote:
>
>> Yes, NULL values are not stored in the index, but you may create
>> functional index on
>
> Are you sure NULL values are not stored? btree, gist and bitmap index and
> search for NULL values.

It's not that they're not stored, it's that before 8.3 pg didn't know
how to compare to them I believe.  The standard trick was to create a
partial index with "where x is null" on the table / column.  8.3 knows
how to compare them and doesn't need the partial index.

pgsql-performance by date:

Previous
From: "Vladimir Sitnikov"
Date:
Subject: Re: Using index for IS NULL query
Next
From: Tom Lane
Date:
Subject: Re: Oddity with view (now with test case)