Skip to content

Commit 8aaecaf

Browse files
committed
We no longer need to palloc the VacuumStmt node; keeping it on the stack is
simpler.
1 parent 23a4157 commit 8aaecaf

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(Oid relid, bool dovacuum, bool doanalyze,
12381238
int freeze_min_age)
12391239
{
1240-
VacuumStmt *vacstmt;
1240+
VacuumStmt vacstmt;
12411241
MemoryContext old_cxt;
12421242

12431243
/*
1244-
* The node must survive transaction boundaries, so make sure we create it
1244+
* The list 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy