Re: Performance issue: index not used on GROUP BY...

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: Performance issue: index not used on GROUP BY...
Дата
Msg-id CABRT9RDQjk6AdAMLE-uft9HT+DwTw0mBA7UN4hXvv_m9kY0Rwg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Performance issue: index not used on GROUP BY...  (gmb <gmbouwer@gmail.com>)
Список pgsql-performance
On Thu, Aug 28, 2014 at 11:50 AM, gmb <gmbouwer@gmail.com> wrote:
> Can somebody please confirm whether aggregate functions such as GROUP BY
> should use indexes ?

Yes, if the planner deems it faster than other approaches. It can make
wrong choices for many reasons, but usually when your planner tunables
like random_page_cost, effective_cache_size aren't set appropriately.

There's some advice here:
https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server

Just for the purpose of testing, you could try "set enable_sort=false"
in your session and see if that makes it faster.

On Thu, Aug 28, 2014 at 12:08 PM, gmb <gmbouwer@gmail.com> wrote:
>         Sort Key: co_id, client_id, doc_no,

Something went missing from this line...

>         Sort Method: external merge  Disk: 80304kB

Depends on your hardware and workloads, but more work_mem may also
improve queries to avoid sorts and hashes needing to use disk. But
beware, setting it too high may result in your server running out of
memory.

Regards,
Marti


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

Предыдущее
От: Victor Yegorov
Дата:
Сообщение: Re: Performance issue: index not used on GROUP BY...
Следующее
От: gmb
Дата:
Сообщение: Re: Performance issue: index not used on GROUP BY...