Re: BUG #14011: select count(distinct column) does not utilizes indices to improve performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14011: select count(distinct column) does not utilizes indices to improve performance
Дата
Msg-id 7830.1457585404@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14011: select count(distinct column) does not utilizes indices to improve performance  (gtakahashi@palantir.com)
Список pgsql-bugs
gtakahashi@palantir.com writes:
> Doing a select count(distinct column) does not utilize indices

Nope, it does not.  Don't hold your breath waiting for that to change;
it might sometime, but nobody is working on it that I know of.

You'd have better luck with a "SELECT count(*) GROUP BY column"
type of query, I expect.  (Most likely that won't use an index either,
BTW, but it'll be smarter than count(distinct).)

            regards, tom lane

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