Re: Indexing null dates - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Indexing null dates
Date
Msg-id 200404200425.i3K4PX507858@candle.pha.pa.us
Whole thread Raw
In response to Re: Indexing null dates  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > +    <literal>NULL</> values are not indexed by default.
>
> This is quite incorrect.  The nulls *are* indexed (at least in btree
> indexes); the issue is whether there is any way to use the index to
> search for them.  I do not think it helps anyone for the documentation
> to get this basic point wrong, even if the distinction is subtle.

OK, docs updated with:

   Indexes can not be used with <literal>IS NULL</> clauses by default.
   The best way to use indexes in such cases is to create a partial index
   using an <literal>IS NULL</> comparison.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: [OT] Tom's/Marc's spam filters?
Next
From: Bruce Momjian
Date:
Subject: Re: [OT] Tom's/Marc's spam filters?