aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/vacuumparallel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/commands/vacuumparallel.c b/src/backend/commands/vacuumparallel.c
index 49e605a6ffc..dc3322c256b 100644
--- a/src/backend/commands/vacuumparallel.c
+++ b/src/backend/commands/vacuumparallel.c
@@ -1032,6 +1032,13 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
vac_open_indexes(rel, RowExclusiveLock, &nindexes, &indrels);
Assert(nindexes > 0);
+ /*
+ * Apply the desired value of maintenance_work_mem within this process.
+ * Really we should use SetConfigOption() to change a GUC, but since we're
+ * already in parallel mode guc.c would complain about that. Fortunately,
+ * by the same token guc.c will not let any user-defined code change it.
+ * So just avert your eyes while we do this:
+ */
if (shared->maintenance_work_mem_worker > 0)
maintenance_work_mem = shared->maintenance_work_mem_worker;