Re: BUG #2658: Query not using index

Поиск
Список
Период
Сортировка
От Chris Browne
Тема Re: BUG #2658: Query not using index
Дата
Msg-id 60d599gqcz.fsf@dba2.int.libertyrms.com
обсуждение исходный текст
Ответ на Re: BUG #2658: Query not using index  (Graham Davis <gdavis@refractions.net>)
Ответы Re: BUG #2658: Query not using index  (Graham Davis <gdavis@refractions.net>)
Список pgsql-performance
gdavis@refractions.net (Graham Davis) writes:
> 40 seconds is much too slow for this query to run and I'm assuming
> that the use of an index will make it much faster (as seen when I
> removed the GROUP BY clause).  Any tips?

Assumptions are dangerous things.

An aggregate like this has *got to* scan the entire table, and given
that that is the case, an index scan is NOT optimal; a seq scan is.

An index scan is just going to be slower.
--
let name="cbbrowne" and tld="linuxdatabases.info" in String.concat "@" [name;tld];;
http://cbbrowne.com/info/linux.html
"The computer is the ultimate polluter: its feces are
indistinguishable from the food it produces." -- Alan J. Perlis

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

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: Performance Optimization for Dummies 2 - the SQL
Следующее
От: Graham Davis
Дата:
Сообщение: Re: BUG #2658: Query not using index