Re: ORDER BY and NULLs - Mailing list pgsql-sql

From Tom Lane
Subject Re: ORDER BY and NULLs
Date
Msg-id 20623.1095620408@sss.pgh.pa.us
Whole thread Raw
In response to Re: ORDER BY and NULLs  (T E Schmitz <mailreg@numerixtechnology.de>)
List pgsql-sql
T E Schmitz <mailreg@numerixtechnology.de> writes:
> Tom Lane wrote:
>> Whatever you were reading had it pretty badly garbled :-(

> 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."

[ shrug ]  It's wrong on both counts, and has been since (checks CVS) 1997.
What book is that anyway?

There is a related statement that is still true: "WHERE x IS NULL"
(or NOT NULL) clauses are not indexscannable.  This is a shortcoming of
the planner-to-index-access-method interface, though, not a question of
whether the index can store NULLs.
        regards, tom lane


pgsql-sql by date:

Previous
From: Greg Stark
Date:
Subject: Re: ORDER BY and NULLs
Next
From: T E Schmitz
Date:
Subject: Re: ORDER BY and NULLs