Re: ORDER BY and NULLs

Поиск
Список
Период
Сортировка
От Murphy Pope
Тема Re: ORDER BY and NULLs
Дата
Msg-id ot9gd.432$j15.304@fe25.usenetserver.com
обсуждение исходный текст
Ответ на Re: ORDER BY and NULLs  (<terry@ashtonwoodshomes.com>)
Список pgsql-sql
>> 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?







В списке pgsql-sql по дате отправления:

Предыдущее
От: "Jon Uhal"
Дата:
Сообщение: Foreign Key Non-Null Problem in 8.0
Следующее
От: Murphy Pope
Дата:
Сообщение: Re: ORDER BY and NULLs