From: Glyn Astill <glynastill@yahoo.co.uk>
To: Daulat Ram <Daulat.Ram@cyient.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Hi
Date: Thu, 13 Apr 2017 08:21:53 +0000 (UTC)
Message-ID: <811150671.1545494.1492071713992@mail.yahoo.com> (raw)
In-Reply-To: <cd6bfba7aab34d3e805b62a986e2ade3@cyient.com>
References: <cd6bfba7aab34d3e805b62a986e2ade3@cyient.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
> From: Daulat Ram <Daulat.Ram@cyient.com>
> To: "pgsql-performance@postgresql.org" <pgsql-performance@postgresql.org>
> Sent: Thursday, 13 April 2017, 7:25
> Subject: [PERFORM] Hi
>
> Hello,
>
> I need to know the criteria behind for settings the work_mem in PostgreSQL, please give the example also if possible.
>
> Regards,
> Daulat
Is there anything in particular from the manual pages you don't understand? It should be quite clear:
https://www.postgresql.org/docs/current/static/runtime-config-resource.html
"Specifies the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files. The value defaults to four megabytes (4MB). Note that for a complex query, several sort or hash operations might be running in parallel; each operation will be allowed to use as much memory as this value specifies before it starts to write data into temporary files."
"Also, several running sessions could be doing such operations concurrently. Therefore, 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."
Glyn
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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-performance@postgresql.org
Cc: glynastill@yahoo.co.uk, Daulat.Ram@cyient.com
Subject: Re: Hi
In-Reply-To: <811150671.1545494.1492071713992@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