From: Murphy Pope <pope_murphy@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: ORDER BY and NULLs
Date: Thu, 28 Oct 2004 12:52:31 -0400
Message-ID: <ot9gd.432$j15.304@fe25.usenetserver.com> (raw)
References: <011d01c49e5b$c88fdb20$2766f30a@development.greatgulfhomes.com>
<414DB1AB.5080207@sympatico.ca>
<414DB594.5000300@numerixtechnology.de>
<19733.1095613137@sss.pgh.pa.us>
<414DBF6D.8040500@numerixtechnology.de>
<87zn3mjeaw.fsf@stark.xeocode.com>
>> 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?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pope_murphy@hotmail.com
Subject: Re: ORDER BY and NULLs
In-Reply-To: <ot9gd.432$j15.304@fe25.usenetserver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox