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

Commit8aaecaf

Browse files
committed
We no longer need to palloc the VacuumStmt node; keeping it on the stack is
simpler.
1 parent23a4157 commit8aaecaf

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

‎src/backend/postmaster/autovacuum.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.34 2007/03/13 00:33:41 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.35 2007/03/23 20:56:39 alvherre Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1237,32 +1237,28 @@ static void
12371237
autovacuum_do_vac_analyze(Oidrelid,booldovacuum,booldoanalyze,
12381238
intfreeze_min_age)
12391239
{
1240-
VacuumStmt*vacstmt;
1240+
VacuumStmtvacstmt;
12411241
MemoryContextold_cxt;
12421242

12431243
/*
1244-
* Thenode must survive transaction boundaries, so make sure we create it
1244+
* Thelist must survive transaction boundaries, so make sure we create it
12451245
* in a long-lived context
12461246
*/
12471247
old_cxt=MemoryContextSwitchTo(AutovacMemCxt);
12481248

1249-
vacstmt=makeNode(VacuumStmt);
1250-
12511249
/* Set up command parameters */
1252-
vacstmt->vacuum=dovacuum;
1253-
vacstmt->full= false;
1254-
vacstmt->analyze=doanalyze;
1255-
vacstmt->freeze_min_age=freeze_min_age;
1256-
vacstmt->verbose= false;
1257-
vacstmt->relation=NULL;/* not used since we pass a relids list */
1258-
vacstmt->va_cols=NIL;
1250+
vacstmt.vacuum=dovacuum;
1251+
vacstmt.full= false;
1252+
vacstmt.analyze=doanalyze;
1253+
vacstmt.freeze_min_age=freeze_min_age;
1254+
vacstmt.verbose= false;
1255+
vacstmt.relation=NULL;/* not used since we pass a relids list */
1256+
vacstmt.va_cols=NIL;
12591257

12601258
/* Let pgstat know what we're doing */
1261-
autovac_report_activity(vacstmt,relid);
1262-
1263-
vacuum(vacstmt,list_make1_oid(relid), true);
1259+
autovac_report_activity(&vacstmt,relid);
12641260

1265-
pfree(vacstmt);
1261+
vacuum(&vacstmt,list_make1_oid(relid), true);
12661262
MemoryContextSwitchTo(old_cxt);
12671263
}
12681264

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp