Type: | integer |
Default: | 65536 (64MB) |
Min: | 64 (64kB) |
Max: | 2147483647 (2147483647kB) |
Unit: | KB |
Context: | user |
Restart: | false |
Specifies the maximum amount of memory to be used by maintenance operations, such as VACUUM, CREATE INDEX, and ALTER TABLE ADD FOREIGN KEY. If this value is specified without units, it is taken as kilobytes. It defaults to 64 megabytes (64MB
). Since only one of these operations can be executed at a time by a database session, and an installation normally doesn't have many of them running concurrently, it's safe to set this value significantly larger than work_mem. Larger settings might improve performance for vacuuming and for restoring database dumps.
Note that when autovacuum runs, up to autovacuum_max_workers times this memory may be allocated, so be careful not to set the default value too high. It may be useful to control for this by separately setting autovacuum_work_mem.
Recommendations
On StackOverflow
On pgsql-hackers
- Proposal for Resumable Vacuum (again ...)
- Re: Add the ability to limit the amount of memory that can be allocated to backends.
- Re: Proposal for Resumable Vacuum (again ...)
- Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.
- Re: Making the initial and maximum DSA segment sizes configurable