Re: work_mem in high transaction rate database

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: work_mem in high transaction rate database
Дата
Msg-id 200903041016.09765.dfontaine@hi-media.com
обсуждение исходный текст
Ответ на Re: work_mem in high transaction rate database  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-performance
Hi,

On Wednesday 04 March 2009 02:37:42 Scott Marlowe wrote:
> If some oddball query really needs a lot of work_mem,
> and benchmarks show something larger work_mem helps, consider raising
> the work_mem setting for that one query to something under 1G (way
> under 1G) That makes it noticeably faster.  Don't allocate more than a
> test shows you helps.

The probably easiest way to integrate this into an existing application is
this way, in my experience:

 BEGIN;
  SET LOCAL work_mem TO '650MB';
  SELECT -- the query requiring such a large setting
 COMMIT;

Right after the commit the global configured work_mem (or the previous
session's one, in fact) will be in effect, you won't have to reset it yourself.

Regards,
--
dim

Вложения

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

Предыдущее
От: Akos Gabriel
Дата:
Сообщение: Re: work_mem in high transaction rate database
Следующее
От: Flavio Henrique Araque Gurgel
Дата:
Сообщение: Re: work_mem in high transaction rate database