Re: work_mem and shared_buffers - Mailing list pgsql-performance

From Campbell, Lance
Subject Re: work_mem and shared_buffers
Date
Msg-id B10E6810AC2A2F4EA7550D072CDE8760197DE5@SAB-FENWICK.sab.uiuc.edu
Whole thread Raw
In response to Re: work_mem and shared_buffers  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: work_mem and shared_buffers
Re: work_mem and shared_buffers
List pgsql-performance
How do you know when you should up the value of work_mem?  Just play
with the number.  Is there a query I could do that would tell me if
PostgreSql is performing SQL that could use more memory for sorting?

Thanks,

Lance Campbell
Project Manager/Software Architect
Web Services at Public Affairs
University of Illinois
217.333.0382
http://webservices.uiuc.edu


-----Original Message-----
From: Heikki Linnakangas [mailto:hlinnaka@gmail.com] On Behalf Of Heikki
Linnakangas
Sent: Friday, November 09, 2007 11:57 AM
To: Campbell, Lance
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] work_mem and shared_buffers

Campbell, Lance wrote:
> Does the amount of memory allocate to work_mem get subtracted from
> shared_buffers?
>
> Example:
>
> If work_mem is 1M and there are 10 connections and shared_buffers is
> 100M then would the total be 90 M left for shared_buffers?
>
> Or does the amount of memory allocated for work_mem have nothing to do
> with shared_buffers?

No, they're completely separate.

Note that a connection can use more than work_mem of memory. For
example, if you run a query with multiple Sort or hash-nodes, each such
node allocates up to work_mem of memory.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-performance by date:

Previous
From: Greg Smith
Date:
Subject: Re: dell versus hp
Next
From: Bill Moran
Date:
Subject: Re: work_mem and shared_buffers