Re: select distinct and index usage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: select distinct and index usage
Дата
Msg-id 13767.1207621831@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: select distinct and index usage  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: select distinct and index usage
Список pgsql-general
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane escribi�:
>> What I think you'll find, though, is that once you do force an indexscan
>> to be picked it'll be slower.  Full-table index scans are typically
>> worse than seqscan+sort, unintuitive though that may sound.

> Hmm, should we switch the CLUSTER code to do that?

It's been suggested before, but I'm not sure.  The case where an
indexscan can win is where the table is roughly in index order already.
So if you think about periodic CLUSTER to maintain table ordering,
I suspect you'd want the indexscan implementation for all but maybe
the first time.

            regards, tom lane

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: select distinct and index usage
Следующее
От: Manuel Sugawara
Дата:
Сообщение: Re: Cannot use a standalone backend to VACUUM in "postgres""