pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: SASIKUMAR Devaraj <sashikumard@yahoo.com>
To: Campbell, Lance <lance@illinois.edu>
To: Bruce Momjian <bruce@momjian.us>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: MichaelDBA <michaeldba@sqlexec.com>
Cc: holger@jakobs.com <holger@jakobs.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: work_mem
Date: Sat, 3 Apr 2021 05:23:56 +0000 (UTC)
Message-ID: <230367927.2421710.1617427436762@mail.yahoo.com> (raw)
In-Reply-To: <20210402153436.GE9270@momjian.us>
References: <A2AA6D08-9506-4B41-9738-4D5FF8E2E011@illinois.edu>
	<04D84259-1B75-4648-949F-78677916194E@jakobs.com>
	<66290583.2329958.1617367063840@mail.yahoo.com>
	<c1e02a03-71cd-4071-e000-967403bcab9d@sqlexec.com>
	<1654783699.2333997.1617367552583@mail.yahoo.com>
	<592e5895-8dbd-1a4f-a87c-af72ac8eea02@sqlexec.com>
	<SN6PR11MB3326EADE632BA4EBE1FA28DCDE7A9@SN6PR11MB3326.namprd11.prod.outlook.com>
	<339e1ee870881a3efaffc7ea4cddac6bc4d009cf.camel@cybertec.at>
	<20210402150736.GD9270@momjian.us>
	<SN6PR11MB332665A6DF1226BF762A44B9DE7A9@SN6PR11MB3326.namprd11.prod.outlook.com>
	<20210402153436.GE9270@momjian.us>

 
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@momjian.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@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.



  

view thread (22+ messages)  latest in thread

Message-ID: <230367927.2421710.1617427436762@mail.yahoo.com>
Permalink:  ../230367927.2421710.1617427436762@mail.yahoo.com/
Also on:    postgresql.org/message-id/230367927.2421710.1617427436762@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: sashikumard@yahoo.com, lance@illinois.edu, bruce@momjian.us, laurenz.albe@cybertec.at, michaeldba@sqlexec.com, holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: work_mem
  In-Reply-To: <230367927.2421710.1617427436762@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox