Re: ORDER BY and NULLs

From: T E Schmitz <mailreg(at)numerixtechnology(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-sql(at)postgresql(dot)org
Subject: Re: ORDER BY and NULLs
Date: 2004-09-19 17:18:37
Message-ID: 414DBF6D.8040500@numerixtechnology.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello Tom,

Tom Lane wrote:

> T E Schmitz <mailreg(at)numerixtechnology(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2004-09-19 18:37:11 Re: ORDER BY and NULLs
Previous Message Tom Lane 2004-09-19 17:12:07 Re: How to check postgres running or not ?