Re: SELECT DISTINCT very slow

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: SELECT DISTINCT very slow
Дата
Msg-id 1247246228.26589.318.camel@monkey-cat.sm.truviso.com
обсуждение исходный текст
Ответ на Re: SELECT DISTINCT very slow  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
On Fri, 2009-07-10 at 01:36 +0100, Greg Stark wrote:
> Arguably the missing feature here is skip-scans where we scan the
> index but only pull out one record for each distinct value. I'm not
> sure there's anything particularly stopping Postgres from being able
> to do them, but it might be a lot of code for a narrow use case.

Hypothetically, would something like a "sort distinct" operator be of
any use? I wonder how much work it would save if the sort could save
steps by weeding out duplicate tuples while sorting. That might make
sort into a better plan in cases where don't have a good estimate of the
distinct values.

Regards,
    Jeff Davis


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

Предыдущее
От: Brandon Metcalf
Дата:
Сообщение: Re: UNION question
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Overhead of union versus union all