Re: Optimizing select count query which often takes over 10 seconds

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Optimizing select count query which often takes over 10 seconds
Дата
Msg-id CAF-3MvPDDmeQnEC66xu603Bep7bfqGaJJnt+h+4KtBtR9Koi0Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Optimizing select count query which often takes over 10 seconds  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general

> It's sorting on disk. That's not going to be fast. Indeed, it's taking
> nearly all the time the query takes (4.4s for this step out of 4.5s for the
> query).

I've noticed that too, but what
does "sorting on disk" mean?

I have a lot of RAM (32 GB) ,
should I increase work_mem even more?
(it is currenlty 32 MB)

You can try increasing the amount of work_mem in your psql session only and see what amount helps. That way you don't need to permanently increase it for all your queries.
I'd start with 48 MB and increase in increments of 16 MB (as that's the size the sort operation claims to require on disk).

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: How to identify the source of a deadlock?
Следующее
От: Steve Clark
Дата:
Сообщение: noobie question