Re: Backwards index scan

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Backwards index scan
Дата
Msg-id 87zmgq7y77.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Backwards index scan  (John Sidney-Woollett <johnsw@wardbrook.com>)
Ответы Re: Backwards index scan
Список pgsql-general
John Sidney-Woollett <johnsw@wardbrook.com> writes:

> I don't think that null values are indexed - you'll probably need to coalesce
> your null data value to some value if you want it indexed.

That is most definitely not true for Postgres. NULL values are included in the
index.

However NULLs sort as greater than all values in Postgres. So when you sort
descending they'll appear *first*. If you sort ascending they'll appear last.

If you have any clauses like 'WHERE col > foo' then it will not be true for
NULL values of col regardless of what foo is and those records will be
dropped. This is true regardless of whether there's an index.


--
greg

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

Предыдущее
От: "Nikolay Samokhvalov"
Дата:
Сообщение: Re: COLLATE
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: [pgsql-advocacy] Me And My Database