Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53a4936

Browse files
committed
Doc: add commentary about cowboy assignment of maintenance_work_mem.
Whilst working on commit041e8b9 I happened to notice thatparallel_vacuum_main() assigns directly to the maintenance_work_memGUC. This is definitely not per project conventions, so I tried tofix it to use SetConfigOption(). But that fails with "parametercannot be set during a parallel operation". It doesn't seem worthworking on a cleaner answer, at least not till we have a few moreinstances of similar problems. But add some commentary, just sonobody gets the idea that this is an approved way to set a GUC.
1 parentd4c3a6b commit53a4936

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/backend/commands/vacuumparallel.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,13 @@ parallel_vacuum_main(dsm_segment *seg, shm_toc *toc)
10321032
vac_open_indexes(rel,RowExclusiveLock,&nindexes,&indrels);
10331033
Assert(nindexes>0);
10341034

1035+
/*
1036+
* Apply the desired value of maintenance_work_mem within this process.
1037+
* Really we should use SetConfigOption() to change a GUC, but since we're
1038+
* already in parallel mode guc.c would complain about that. Fortunately,
1039+
* by the same token guc.c will not let any user-defined code change it.
1040+
* So just avert your eyes while we do this:
1041+
*/
10351042
if (shared->maintenance_work_mem_worker>0)
10361043
maintenance_work_mem=shared->maintenance_work_mem_worker;
10371044

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp