Re: Hi

From: Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk>
To: Daulat Ram <Daulat(dot)Ram(at)cyient(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Hi
Date: 2017-04-13 08:21:53
Message-ID: 811150671.1545494.1492071713992@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


> From: Daulat Ram <Daulat(dot)Ram(at)cyient(dot)com>
> To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)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

In response to

  • Hi at 2017-04-13 06:25:17 from Daulat Ram

Browse pgsql-performance by date

  From Date Subject
Next Message Reza Taheri 2017-04-13 19:30:54 Postgresql, and ODBC handles
Previous Message Daulat Ram 2017-04-13 06:25:17 Hi