>> I just dug out the PostgreSQL book again because I thought I might've
>> garbled it:
>>
>> Quote: "PostgreSQL will not index NULL values. Because an index will
>> never include NULL values, it cannot be used to satisfy the ORDER BY
>> clause of a query that returns all rows in a table."
>
> You should just cross out that whole section. It's just flatly wrong.
>
> I had always assumed it was just people bringing assumptions over from
> Oracle where it is true. Perhaps this book is to blame for some of the
> confusion. Which book is it?
>
> Postgres indexes NULLs. It can use them for ORDER BY clauses.
Now I'm confused... here's a quote from Bruce Momjian from Oct. 2003:
> To be specific, we do not do index NULL values in a column, but we
> easily index non-null values in the column.
And a comment from backend/access/gist/gist.c (appears a few times):
> GiST cannot index tuples with leading NULLs
So what's the story? Do GiST indexes index NULLs? Do other index types
index NULLs? Is the comment wrong or am I misreading it?