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

Commit848ae33

Browse files
committed
Increase work_mem and maintenance_work_mem defaults by 4x
New defaults are 4MB and 64MB.
1 parent6f14a6f commit848ae33

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ include 'filename'
12131213
<para>
12141214
Specifies the amount of memory to be used by internal sort operations
12151215
and hash tables before writing to temporary disk files. The value
1216-
defaults toone megabyte (<literal>1MB</>).
1216+
defaults tofour megabytes (<literal>4MB</>).
12171217
Note that for a complex query, several sort or hash operations might be
12181218
running in parallel; each operation will be allowed to use as much memory
12191219
as this value specifies before it starts to write data into temporary
@@ -1239,7 +1239,7 @@ include 'filename'
12391239
Specifies the maximum amount of memory to be used by maintenance
12401240
operations, such as <command>VACUUM</command>, <command>CREATE
12411241
INDEX</>, and <command>ALTER TABLE ADD FOREIGN KEY</>. It defaults
1242-
to16 megabytes (<literal>16MB</>). Since only one of these
1242+
to64 megabytes (<literal>64MB</>). Since only one of these
12431243
operations can be executed at a time by a database session, and
12441244
an installation normally doesn't have many of them running
12451245
concurrently, it's safe to set this value significantly larger

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ static struct config_int ConfigureNamesInt[] =
17731773
GUC_UNIT_KB
17741774
},
17751775
&work_mem,
1776-
1024,64,MAX_KILOBYTES,
1776+
4096,64,MAX_KILOBYTES,
17771777
NULL,NULL,NULL
17781778
},
17791779

@@ -1784,7 +1784,7 @@ static struct config_int ConfigureNamesInt[] =
17841784
GUC_UNIT_KB
17851785
},
17861786
&maintenance_work_mem,
1787-
16384,1024,MAX_KILOBYTES,
1787+
65536,1024,MAX_KILOBYTES,
17881788
NULL,NULL,NULL
17891789
},
17901790

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124
# per transaction slot, plus lock space (see max_locks_per_transaction).
125125
# It is not advisable to set max_prepared_transactions nonzero unless you
126126
# actively intend to use prepared transactions.
127-
#work_mem =1MB# min 64kB
128-
#maintenance_work_mem =16MB# min 1MB
127+
#work_mem =4MB# min 64kB
128+
#maintenance_work_mem =64MB# min 1MB
129129
#autovacuum_work_mem = -1# min 1MB, or -1 to use maintenance_work_mem
130130
#max_stack_depth = 2MB# min 100kB
131131
#dynamic_shared_memory_type = posix # the default is the first option

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp