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

Commited5699d

Browse files
committed
In pg_upgrade, set synchronous_commit=off for the new cluster, to
improve performance when restoring the schema from the old cluster.Backpatch to 9.2.
1 parent5ed6546 commited5699d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎contrib/pg_upgrade/server.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,18 @@ start_postmaster(ClusterInfo *cluster)
208208
* maximum. We assume all datfrozenxid and relfrozen values are less than
209209
* a gap of 2000000000 from the current xid counter, so autovacuum will
210210
* not touch them.
211+
*
212+
*synchronous_commit=off improves object creation speed, and we only
213+
*modify the new cluster, so only use it there. If there is a crash,
214+
*the new cluster has to be recreated anyway.
211215
*/
212216
snprintf(cmd,sizeof(cmd),
213-
"\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" -o \"-p %d %s%s%s\" start",
217+
"\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" -o \"-p %d%s%s%s%s\" start",
214218
cluster->bindir,SERVER_LOG_FILE,cluster->pgconfig,cluster->port,
215219
(cluster->controldata.cat_ver >=
216-
BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ?"-b" :
217-
"-c autovacuum=off -c autovacuum_freeze_max_age=2000000000",
220+
BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ?" -b" :
221+
" -c autovacuum=off -c autovacuum_freeze_max_age=2000000000",
222+
(cluster==&new_cluster) ?" -c synchronous_commit=off" :"",
218223
cluster->pgopts ?cluster->pgopts :"",socket_string);
219224

220225
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp