workmem
Work_mem is a PostgreSQL configuration parameter that controls the amount of memory available to a back-end process for internal operations during query execution, such as sorting, hashing, and materialization of intermediate results. The value applies to individual operations and is allocated for the duration of a query or a set of operations within a session.
Units and default: The work_mem value is expressed in kilobytes or megabytes (for example "4MB", "64MB"). The
Configuration and scope: Work_mem can be set in the server configuration file postgresql.conf, or per-session with
Impact on performance and planning: Increasing work_mem can speed up queries that rely on sorts or hash
Relation to other memory settings: work_mem is distinct from maintenance_work_mem, which governs resources used for maintenance