From: | SASIKUMAR Devaraj <sashikumard(at)yahoo(dot)com> |
---|---|
To: | "Campbell, Lance" <lance(at)illinois(dot)edu>, Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, MichaelDBA <michaeldba(at)sqlexec(dot)com>, "holger(at)jakobs(dot)com" <holger(at)jakobs(dot)com>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | Re: work_mem |
Date: | 2021-04-03 05:23:56 |
Message-ID: | 230367927.2421710.1617427436762@mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Hi All
One basic doubt.
Whether work_mem is allocated for each clients connected to Database or for against the Sort Operations(Queries) in database? Please clarify
Case 1: work_mem=4mTotal Sessions connected=100Total=400M
Or Case 2work_mem=4mTotal Sort operations at DB now=50Total work_mem=200M
Please clarify at high level whether Case 1 is true or Case 2 is true?
Regards
Sasi On Friday, 2 April, 2021, 09:04:56 pm IST, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
On Fri, Apr 2, 2021 at 03:25:04PM +0000, Campbell, Lance wrote:
> Thanks for sharing this thread. My suggestion of having a work_mem_stack_size
> is the same concept mentioned in this thread regarding having a work_mem_pool.
> I prefer this later term rather than the one I was using. When the work mem
> pool is exhausted PostgreSQL just uses temp files for work_mem. With current
> statics for temp files and with a new stats on a work mem pool usage a user
> could fine tune memory much more precisely. It would leave the “art of memory
> tuning” behind. The other added benefit is that people would have a better
> understanding of how work_mem is used by naturally having to explain what a
> work_mem_pool is and when it is drawn on. There are probably a lot of
> PostgreSQL instance that would run faster just by having the confidence to
> increase the size of work_mem. I am sure many instances have this value set to
> low.
Uh, did you read the blog before it, referenced in that blog entry:
https://momjian.us/main/blogs/pgblog/2018.html#December_7_2018
Even if we have a pool, it is still complex to configure memory, but it
might help.
--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com
If only the physical world exists, free will is an illusion.
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2021-04-03 05:44:13 | Re: work_mem |
Previous Message | David G. Johnston | 2021-04-02 22:58:06 | Re: Global memory or local memory? (was Re: work_mem) |