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

how much memory (work_mem) is a query using?

From
Kevin Kempter
Date:
Hi all;

is it possible to see how much work_mem memory a particular session is using?




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

From
raghu ram
Date:


On Tue, Jun 30, 2009 at 5:20 AM, Kevin Kempter <kevink@consistentstate.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@postgresql.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