pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: mailreg@numerixtechnology.de
Cc: pgsql-sql@postgresql.org
Subject: Re: ORDER BY and NULLs
Date: Sun, 19 Sep 2004 15:00:08 -0400
Message-ID: <20623.1095620408@sss.pgh.pa.us> (raw)
In-Reply-To: <414DBF6D.8040500@numerixtechnology.de>
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>

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



view thread (16+ messages)  latest in thread

Message-ID: <20623.1095620408@sss.pgh.pa.us>
Permalink:  ../20623.1095620408@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20623.1095620408@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, mailreg@numerixtechnology.de
  Subject: Re: ORDER BY and NULLs
  In-Reply-To: <20623.1095620408@sss.pgh.pa.us>

* 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