Re: how much memory (work_mem) is a query using?

From: raghu ram <raghuchennuru(at)gmail(dot)com>
To: Kevin Kempter <kevink(at)consistentstate(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how much memory (work_mem) is a query using?
Date: 2009-07-01 03:44:46
Message-ID: d331f2ee0906302044k721b144ev3a62688f19eaa773@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Jun 30, 2009 at 5:20 AM, Kevin Kempter
<kevink(at)consistentstate(dot)com>wrote:

> Hi all;
>
> is it possible to see how much work_mem memory a particular session is
> using?
>
>
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

Hi,

You can’t able to see memory allocated for the particular session in
database.

The work_mem specifies the amount of memory to be used by internal sort
operations and hash tables before switching to temporary disk files. The
default value in database is 1MB.

Several running sessions could be doing such operations concurrently, so the
total memory used could be many times the value of work_mem (It is necessary
to keep this fact in mind when choosing the value).

Sort operations are used for ORDER BY, DISTINCT, and merge joins. Hash
tables are used in hash joins, hash-based aggregation, and hash-based
processing of IN subqueries.
Thanks & Regards,
Raghu Ram

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2009-07-01 05:58:08 Re: Restiring pg_dump text file
Previous Message Scott Mead 2009-07-01 03:36:38 Re: Restiring pg_dump text file