Thank you Jay! Actually I just interesting it. Just looking for ways to make better performance to the forum but if it can cause problems then maybe better if I leave it commented out.
So if I active it there is a good chance to run out memory if the tuning not correct or the traffic increasing? If i understand it correctly.
Sets the base maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files. If this value is specified without units, it is taken as kilobytes. The default value is four megabytes (
4MB ). Note that for a complex query, several sort or hash operations might be running in parallel; each operation will generally 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
Hash-based operations are generally more sensitive to memory availability than equivalent sort-based operations. The memory available for hash tables is computed by multiplying
hash_mem_multiplier . This makes it possible for hash-based operations to use an amount of memory that exceeds the usual
work_mem base amount.