Re: Performance tradeoff

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Performance tradeoff
Дата
Msg-id 200503022131.01658.josh@agliodbs.com
обсуждение исходный текст
Ответ на Performance tradeoff  ("Shawn Chisholm" <schisholm@sandvine.com>)
Список pgsql-performance
Shawn,

> I can also change the schema to a certain extent, so would it be worthwhile
> to put indices on the queried tables (or refactor them) hoping the distinct
> does an index scan instead of sort...  would the query planner take
> advantage of that?

Use the GROUP BY, with an index on the grouped columns and lots of work_mem
(sort_mem in 7.4).   This will give the planner the option of a hashaggregate
which could be significantly faster than the other methods.

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

Предыдущее
От: John A Meinel
Дата:
Сообщение: Re: Help with tuning this query (more musings)
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Help with tuning this query