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

Commit2eda3df

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 parent6bec76f commit2eda3df

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
@@ -3332,12 +3332,12 @@ check_autovacuum_work_mem(int *newval, void **extra, GucSource source)
33323332
return true;
33333333

33343334
/*
3335-
* We clamp manually-set values to at least1MB. Since
3335+
* We clamp manually-set values to at least64kB. Since
33363336
* maintenance_work_mem is always set to at least this value, do the same
33373337
* here.
33383338
*/
3339-
if (*newval<1024)
3340-
*newval=1024;
3339+
if (*newval<64)
3340+
*newval=64;
33413341

33423342
return true;
33433343
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2447,14 +2447,19 @@ struct config_int ConfigureNamesInt[] =
24472447
NULL,NULL,NULL
24482448
},
24492449

2450+
/*
2451+
* Dynamic shared memory has a higher overhead than local memory contexts,
2452+
* so when testing low-memory scenarios that could use shared memory, the
2453+
* recommended minimum is 1MB.
2454+
*/
24502455
{
24512456
{"maintenance_work_mem",PGC_USERSET,RESOURCES_MEM,
24522457
gettext_noop("Sets the maximum memory to be used for maintenance operations."),
24532458
gettext_noop("This includes operations such as VACUUM and CREATE INDEX."),
24542459
GUC_UNIT_KB
24552460
},
24562461
&maintenance_work_mem,
2457-
65536,1024,MAX_KILOBYTES,
2462+
65536,64,MAX_KILOBYTES,
24582463
NULL,NULL,NULL
24592464
},
24602465

‎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