Re: select distinct

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: select distinct
Дата
Msg-id
4066.964839300@sss.pgh.pa.us
Ответ на
select distinct (Timothy H. Keitt)
Список
Дерево обсуждения
select distinct "Timothy H. Keitt" <keitt@nceas.ucsb.edu>
Re: select distinct Tom Lane <tgl@sss.pgh.pa.us>
"Timothy H. Keitt"  writes:
> Couldn't you just traverse the index to get the distinct values?

No, because the index doesn't contain commit status; you can't tell
which values are actually valid without visiting the main table.

7.0 does consider both indexscan | unique and seqscan | sort | unique
plans for this problem, but the explicit sort is usually faster
(according to the system's cost models, anyway).
		regards, tom lane

В списке pgsql-hackers по дате отправления
От: Timothy H. Keitt
Дата:
Сообщение: select distinct
От: Thomas Lockhart
Дата:
FAQ