Skip to content

Commit 8720382

Browse files
Merge pull request #264809 from AlicjaKucharczyk/patch-4
maintenance_work_mem fix
2 parents 278472f + fc20e3f commit 8720382

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

articles/postgresql/flexible-server/concepts-server-parameters.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,19 @@ To find the minimum `work_mem` value for a specific query, especially one genera
143143

144144
| Attribute | Value |
145145
|:---------------------|--------------------:|
146-
| Default value | 211MB |
146+
| Default value | Dependent on server memory |
147147
| Allowed value | 1MB-2GB |
148148
| Type | Dynamic |
149149
| Level | Global and granular |
150150
| Azure-Specific Notes | |
151151

152152
#### Description
153-
`maintenance_work_mem` is a configuration parameter in PostgreSQL that governs the amount of memory allocated for maintenance operations, such as `VACUUM`, `CREATE INDEX`, and `ALTER TABLE`. Unlike `work_mem`, which affects memory allocation for query operations, `maintenance_work_mem` is reserved for tasks that maintain and optimize the database structure. Adjusting this parameter appropriately can help enhance the efficiency and speed of database maintenance operations.
153+
`maintenance_work_mem` is a configuration parameter in PostgreSQL that governs the amount of memory allocated for maintenance operations, such as `VACUUM`, `CREATE INDEX`, and `ALTER TABLE`. Unlike `work_mem`, which affects memory allocation for query operations, `maintenance_work_mem` is reserved for tasks that maintain and optimize the database structure.
154+
155+
#### Key points
156+
157+
* **Vacuum memory cap**: If you intend to speed up the cleanup of dead tuples by increasing `maintenance_work_mem`, be aware that VACUUM has a built-in limitation for collecting dead tuple identifiers, with the ability to use only up to 1GB of memory for this process.
158+
* **Separation of memory for autovacuum**: The `autovacuum_work_mem` setting allows you to control the memory used by autovacuum operations independently. It acts as a subset of the `maintenance_work_mem`, meaning that you can decide how much memory autovacuum uses without affecting the memory allocation for other maintenance tasks and data definition operations.
154159

155160

156161
## Next steps

0 commit comments

Comments
 (0)