Re: Changing work_mem

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: rihad <rihad(at)mail(dot)ru>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Changing work_mem
Date: 2019-08-13 16:22:05
Message-ID: CAKoxK+6ptxsmNegLmwBEDfBNvEAExDzrd8fthp6T5GwgMoggfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 13, 2019 at 5:59 PM rihad <rihad(at)mail(dot)ru> wrote:
> [dbname] LOG: temporary file: path
> "base/pgsql_tmp/pgsql_tmp93683.257381", size 594
>

The setting 'work_mem' is within context 'user', that means it will
affect running sessione unless the session itself has already issued a
SET work_mem to xxx.
So this could be a reason why you don't seem to see any change.

Also keep in mind that work_mem work on a connection basis, so you are
going to possibly see 521MB x num_connections if all your clients are
doig the same kind of sort concurrently, which probably causes
PostgreSQL to go to disk due to memory unavailable.

Hope this helps.
Luca

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Souvik Bhattacherjee 2019-08-13 16:32:35 Re: Bulk Inserts
Previous Message rihad 2019-08-13 15:59:20 Re: Changing work_mem