Configuration / Resource Usage
sort_mem
Read the PG 7.4 manualSpecifies the amount of memory to be used by internal sort operations and hash tables before switching to temporary disk files.
Reading PG 7.4·documented in 1 of 24 versions, 7.4 to 7.4
Historical documentation for a PostgreSQL version that is no longer supported.
- Type
- integer
- Context
- See manual
- Measured default
- No measurement for this version
- Unit
- —
Definition PG 7.4 manual
Specifies the amount of memory to be used by internal sort operations and hash tables before switching to temporary disk files. The value is specified in kilobytes, and defaults to 1024 kilobytes (1 MB). Note that for a complex query, several sort or hash operations might be running in parallel; each one will be allowed to use as much memory as this value specifies before it starts to put data into temporary files. Also, several running sessions could be doing sort operations simultaneously. So the total memory used could be many times the value of sort_mem. Sort operations are used by ORDER BY, merge joins, and CREATE INDEX. Hash tables are used in hash joins, hash-based aggregation, and hash-based processing of IN subqueries. Because CREATE INDEX is used when restoring a database, increasing sort_mem before doing a large restore operation can improve performance.
Version history 1
- 7.4 → 8.0 removed
Definition snapshot: english-manuals:56283cb52aa7d965a395aab7e04… · English manual source