Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSJBj-0004ew-Es for pgsql-admin@arkaria.postgresql.org; Fri, 02 Apr 2021 12:46:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lSJBi-0002YG-CO for pgsql-admin@arkaria.postgresql.org; Fri, 02 Apr 2021 12:46:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSJBi-0002Y8-3J for pgsql-admin@lists.postgresql.org; Fri, 02 Apr 2021 12:46:10 +0000 Received: from sonic308-19.consmr.mail.sg3.yahoo.com ([106.10.241.209]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lSJBe-0000u1-Mb for pgsql-admin@lists.postgresql.org; Fri, 02 Apr 2021 12:46:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1617367561; bh=nFuZffcC8V53QK8r4Kpx6llIDGbxv+8v6X0KuFiJxeA=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=RtQ44fFfis2cjlbz2eycBNYzXmyiQIIurTLqL2TVki241NnPp6XGzLdpHgGJhlQg2OIy203oNebPEShH/LoxUIaTZTlURlc0thOWkoatrUWQpcw5brWv54BV5RS/M+y2Zt4HzeEWT/m2W29x54MdrXTTOa3YlO6+HyGj+fuwJQP+Aep7k1HuO2VxLunQfIn13qXNmQgMkQqFI7VpAQCParjKcFfAD4J6d2yLqcjWU1A13/t3Jcasdrzvw4h94/bQuen4TJHJ1lDnYZMqVwez7wVS1TLegH/pHp8feEcFMl7WuODcQzT1wUBw5fXXAKE08LPfOU6INDZgZxF1HkMrGg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1617367561; bh=Dr7KlSsdsJOAgnFiF2hR+eesNkVnCI2DpE5C8QfJutz=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=ltubquFUIpd6RJ21Ay83RYCcD0KZM084YDuVudsAIQHjGk/vKbcDz7YhRWtVXUIWrJsvFVrkuzf22nXH34jMDVzAD/9xRuVF+u6lIJr0KpslTeWmU0QHKhOr5FQSSca1L3fDVBhPYxANdChYKwwvE1vb9QQwxBpd8tHKyYv2gsrdlRs5tR9rOQbraO+nUGH/JXYaoMOHiDBpn+wSlN1XhB4/pyWAW/IpwjrwudID5f3fDHKYb+wHaQ5R3V2WxeFMPc+nQ4OxphebCZhes7M/g7clrOlSN9Hn7xoL6eFi+cH9GRXW1pMvArqll4qR2+U2Zu39cAxw8Q5tfgX2w9MznA== X-YMail-OSG: Jo8TQZEVM1mwS69ujCI8yH1fYdM0d2URGBBkhbnqCmNq92cr3I7q.IPi7MAwU13 ekw9juJxrZeMUp5SWb1NQ1ew.wPJckbD4YmyCnhCRKm2xyfO4wwi3BToWcIb8bS.mmmBdZ8iW5dh UowPISDefC_DmWIoK7EnhY1PTCr6Mmi3qITx2SJuu_Hmy3CaXMiYN_.KBDMbbyV85hPKdEHlVUpR 8HxHbLZ7Hxvl5IEU1T.DOwYBOiTa.wVd_Cllrl_ACn_chHz.bXbYSPsH3gU1ih6nGpPdMi.e_IpK heROWgL1zrgG0cXjRdmQPysUdqOu83j9_UD7EJsPPGDSFD3j5QX2gWIAth5FtGMq095XsGtG1k4W fPxcTIrTtPQVZRxoQotH2PSugiLfiogYMS5vIh3JKn6L3wJIZv6YwSJURs6zF3s2qo737nwrvpsy O58me1l1Ut5eah8ELCAQAuVfKEnI4R0dMuVS9R4hVwJCmvt.DMnysjPH6cKQ5fPXvLfMuBaVz1VM auFc9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vL brkoWANchAN.2 X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.sg3.yahoo.com with HTTP; Fri, 2 Apr 2021 12:46:01 +0000 Date: Fri, 2 Apr 2021 12:45:52 +0000 (UTC) From: SASIKUMAR Devaraj Reply-To: SASIKUMAR Devaraj To: MichaelDBA@sqlexec.com, MichaelDBA Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org Message-ID: <1654783699.2333997.1617367552583@mail.yahoo.com> In-Reply-To: References: <04D84259-1B75-4648-949F-78677916194E@jakobs.com> <66290583.2329958.1617367063840@mail.yahoo.com> Subject: Re: work_mem MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2333996_1162366205.1617367552581" X-Mailer: WebService/1.1.17936 YahooMailAndroidMobile YMobile/1.0 (com.yahoo.mobile.client.android.mail/6.22.3; Android/11; RP1A.200720.012; m31; samsung; SM-M315F; 5.91; 2131x1080;) Content-Length: 11637 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_2333996_1162366205.1617367552581 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Michael=C2=A0 For example work_mem is 4M and if I had 300 connections connected to dB the= total memory requirement is 1.2 Gb.=C2=A0So as per my understanding this 1= .2 gb is not allocated as soon as 300 connections established, but it may v= ary from 0 to 1.2gb as per operations from client. Please confirm=C2=A0 Regards Sasi Sent from Yahoo Mail on Android=20 =20 On Fri, Apr 2, 2021 at 6:09 PM, MichaelDBA wrote:= Memory is allocated dynamically per internal work_mem buffer requests.= =20 SASIKUMAR Devaraj wrote on 4/2/2021 8:37 AM: =20 Hi All=20 As soon as client session is established work_mem will be allocated or onl= y when sort happens for that particular session? Please advise how the inte= rnal behavior? This will help me to configure my database memory with high = connections=20 Regards=20 Sasi Sent from Yahoo Mail on Android=20 =20 On Wed, Mar 31, 2021 at 8:52 PM, Holger Jakobs wrote: = #yiv8729720470 -- filtered {}#yiv8729720470 filtered {}#yiv8729720470 filt= ered {}#yiv8729720470 p.yiv8729720470MsoNormal, #yiv8729720470 li.yiv872972= 0470MsoNormal, #yiv8729720470 div.yiv8729720470MsoNormal {margin:0in;font-s= ize:12.0pt;font-family:sans-serif;}#yiv8729720470 span.yiv8729720470EmailSt= yle17 {font-family:sans-serif;color:windowtext;}#yiv8729720470 .yiv87297204= 70MsoChpDefault {font-size:12.0pt;font-family:sans-serif;}#yiv8729720470 fi= ltered {}#yiv8729720470 div.yiv8729720470WordSection1 {}#yiv8729720470 You = can show any or all settings with the command SHOW. show work_mem; show all; How many times the amount of work_mem has been allocated currently cannot b= e shown this way. Any sort operation running currently allocates it. So it = is not identical with the number of current queries, because queries can al= locate it several times. Am 31. M=C3=A4rz 2021 16:04:07 MESZ schrieb "Campbell, Lance" : PostgreSQL 12 =20 =C2=A0 =20 Is there a query that will tell us at any given time what amount of Postgre= SQL memory is being used for work_mem? =C2=A0 =20 =C2=A0 =20 Thanks, =20 =C2=A0 =20 LANCE CAMPBELL =20 =C2=A0 =20 Web Services =20 Public Affairs =20 =C2=A0 =20 =C2=A0 =20 =20 =C2=A0 =20 Under the Illinois Freedom of Information Act any written communication to = or from university employees regarding university business is a public reco= rd and may be subject to public disclosure. =20 =C2=A0 =20 --=20 Holger Jakobs, Bergisch Gladbach +49 178 9759012 - sent from mobile, therefore short - =20 =20 ------=_Part_2333996_1162366205.1617367552581 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Michael 
For example wo= rk_mem is 4M and if I had 300 connections connected to dB the total memory = requirement is 1.2 Gb.
 So as per my understanding this 1.2 gb is not allocated as soon= as 300 connections established, but it may vary from 0 to 1.2gb as per ope= rations from client. Please confirm 

Regards

Sasi
=

<= div>On Fri, Apr 2, 2021 at 6:09 PM, MichaelDBA
<MichaelDBA@sql= exec.com> wrote:
Memory is allocated dynamically per internal work_mem buffer requests.

SASIKUMAR Devaraj wrote on 4/2/2021 8:37 AM:
Hi All

As soon= as client=20 session is established work_mem will be allocated or only when sort=20 happens for that particular session? Please advise how the internal=20 behavior? This will help me to configure my database memory with high=20 connections

Regards=

Sasi

On Wed,= Mar 31, 2021 at 8:52 PM, Holger Jakobs
You can show any or all settings with the=20 command SHOW.

show work_mem;
show all;

How many times=20 the amount of work_mem has been allocated currently cannot be shown this way. Any sort operation running currently allocates it. So it is not=20 identical with the number of current queries, because queries can=20 allocate it several times.


Am 31. M=C3=A4rz 2021=20 16:04:07 MESZ schrieb "Campbell, Lance" <lance@illinois.edu>:

Postg= reSQL 12

=20

&nbs= p;

=20

Is=20 there a query that will tell us at any given time what amount of=20 PostgreSQL memory is being used for work_mem?  

=20

&nbs= p;

=20

Thank= s,

=20

&nbs= p;

=20

LANCE CAMPBELL

=20

 

=20

Web Services

=20

Public Affairs

=20

 

=20

 

=20

=3D"/var/folders/wp/1f6l7hw95y718z976kgnl5f9kr5rtc/T/com.microsoft.Outlook/=

=20

 

=20

Under the Illinois Freedom of=20 Information Act any written communication to or from university=20 employees regarding university business is a public record and may be=20 subject to public disclosure.

=20

 

=20

--
Hol= ger Jakobs, Bergisch Gladbach
+49 178 9759012
- sent from mobile, therefore short -

------=_Part_2333996_1162366205.1617367552581--