Re: select distinct

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: select distinct
Дата
Msg-id 4066.964839300@sss.pgh.pa.us
обсуждение исходный текст
Ответ на select distinct  ("Timothy H. Keitt" <keitt@nceas.ucsb.edu>)
Список pgsql-hackers
"Timothy H. Keitt" <keitt@nceas.ucsb.edu> 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
Дата:
Сообщение: Re: Questionable coding in proc.c & lock.c