pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: T E Schmitz <mailreg@numerixtechnology.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-sql@postgresql.org
Subject: Re: ORDER BY and NULLs
Date: Sun, 19 Sep 2004 18:18:37 +0100
Message-ID: <414DBF6D.8040500@numerixtechnology.de> (raw)
In-Reply-To: <19733.1095613137@sss.pgh.pa.us>
References: <011d01c49e5b$c88fdb20$2766f30a@development.greatgulfhomes.com>
	<414DB1AB.5080207@sympatico.ca>
	<414DB594.5000300@numerixtechnology.de>
	<19733.1095613137@sss.pgh.pa.us>

Hello Tom,

Tom Lane wrote:

> T E Schmitz <mailreg@numerixtechnology.de> writes:
> 
>>I read somewhere that an Index is not 
>>going to improve the performance of an ORDER BY if the sort column 
>>contains NULLs because NULLs aren't indexed?
> 
> 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."


> Btree indexes *do* store nulls, so the presence of nulls doesn't affect

Thank you for your explanations. At the moment the table has only 1300 
entries and any query is responsive. I'm just planning ahead...

-- 


Regards/Gruß,

Tarlika Elisabeth Schmitz



view thread (16+ messages)  latest in thread

Message-ID: <414DBF6D.8040500@numerixtechnology.de>
Permalink:  ../414DBF6D.8040500@numerixtechnology.de/
Also on:    postgresql.org/message-id/414DBF6D.8040500@numerixtechnology.de

 · 

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

* 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