PGSQL_WORK_MEM

The PGSQL_WORK_MEM variable specifies the amount of memory to be used by internal sort operations and hash tables before switching to temporary disk files. .

Comments

The right value for this variable depends in part on the available RAM on the server where your site is running.

See What are the right PostgreSQL settings for my site? for values recommended by CollabNet.