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

From T E Schmitz
Subject Re: ORDER BY and NULLs
Date
Msg-id 414DBF6D.8040500@numerixtechnology.de
Whole thread Raw
In response to Re: ORDER BY and NULLs  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ORDER BY and NULLs  (Greg Stark <gsstark@mit.edu>)
Re: ORDER BY and NULLs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to check postgres running or not ?
Next
From: Greg Stark
Date:
Subject: Re: ORDER BY and NULLs