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

Commitbbf668d

Browse files
committed
Lower minimum maintenance_work_mem to 64kB
Since the introduction of TID store, vacuum uses far less memory inthe common case than in versions 16 and earlier. Invoking multiplerounds of index vacuuming in turn requires a much larger table. It'dbe a good idea anyway to cover this case in regression testing, and alower limit is less painful for slow buildfarm animals. The reason todo it now is to re-enable coverage of the bugfix in commit83c39a1.For consistency, give autovacuum_work_mem the same treatment.Suggested by Andres FreundTested by Melanie PlagemanBackpatch to v17, where TID store was introducedDiscussion:https://postgr.es/m/20240516205458.ohvlzis5b5tvejru@awork3.anarazel.deDiscussion:https://postgr.es/m/20240722164745.fvaoh6g6zprisqgp%40awork3.anarazel.de
1 parentf5a1311 commitbbf668d

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

‎src/backend/postmaster/autovacuum.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,12 +3339,12 @@ check_autovacuum_work_mem(int *newval, void **extra, GucSource source)
33393339
return true;
33403340

33413341
/*
3342-
* We clamp manually-set values to at least1MB. Since
3342+
* We clamp manually-set values to at least64kB. Since
33433343
* maintenance_work_mem is always set to at least this value, do the same
33443344
* here.
33453345
*/
3346-
if (*newval<1024)
3347-
*newval=1024;
3346+
if (*newval<64)
3347+
*newval=64;
33483348

33493349
return true;
33503350
}

‎src/backend/utils/misc/guc_tables.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2510,14 +2510,19 @@ struct config_int ConfigureNamesInt[] =
25102510
NULL,NULL,NULL
25112511
},
25122512

2513+
/*
2514+
* Dynamic shared memory has a higher overhead than local memory contexts,
2515+
* so when testing low-memory scenarios that could use shared memory, the
2516+
* recommended minimum is 1MB.
2517+
*/
25132518
{
25142519
{"maintenance_work_mem",PGC_USERSET,RESOURCES_MEM,
25152520
gettext_noop("Sets the maximum memory to be used for maintenance operations."),
25162521
gettext_noop("This includes operations such as VACUUM and CREATE INDEX."),
25172522
GUC_UNIT_KB
25182523
},
25192524
&maintenance_work_mem,
2520-
65536,1024,MAX_KILOBYTES,
2525+
65536,64,MAX_KILOBYTES,
25212526
NULL,NULL,NULL
25222527
},
25232528

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@
139139
# you actively intend to use prepared transactions.
140140
#work_mem = 4MB# min 64kB
141141
#hash_mem_multiplier = 2.0# 1-1000.0 multiplier on hash table work_mem
142-
#maintenance_work_mem = 64MB# min1MB
143-
#autovacuum_work_mem = -1# min1MB, or -1 to use maintenance_work_mem
142+
#maintenance_work_mem = 64MB# min64kB
143+
#autovacuum_work_mem = -1# min64kB, or -1 to use maintenance_work_mem
144144
#logical_decoding_work_mem = 64MB# min 64kB
145145
#max_stack_depth = 2MB# min 100kB
146146
#shared_memory_type = mmap# the default is the first option

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp