work_mem

A GUC parameter specifying the maximum amount of memory available for internal sort operations and hash tables

work_mem is a GUC parameter specifying the maximum amount of memory available for internal sort operations and hash tables, beyond which the operations will spill to disk (and risk becoming considerably slower).

Default value

Default value for work_mem is:

  • PostgreSQL 9.4 and later: 4MB
  • PostgreSQL 9.3 and earlier: 1MB

Changes to work_mem require a reload to take effect and are effective immediately for all backends.

Change history

Categories

Configuration, GUC configuration item, Memory

See also

maintenance_work_mem, hash_mem_multiplier