diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2007-03-23 20:56:39 +0000 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2007-03-23 20:56:39 +0000 |
commit | 8aaecaf809d8700688415f8c92785404486b85b1 (patch) | |
tree | 02471aeb9d4a3d3e644e07a893e4a680b68bb4c2 /src | |
parent | 23a41573c4fcf32c406d5c4a81a4f2645dbd8304 (diff) | |
download | postgresql-8aaecaf809d8700688415f8c92785404486b85b1.tar.gz postgresql-8aaecaf809d8700688415f8c92785404486b85b1.zip |
We no longer need to palloc the VacuumStmt node; keeping it on the stack is
simpler.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/postmaster/autovacuum.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index b2918558305..466f03a5f54 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.34 2007/03/13 00:33:41 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.35 2007/03/23 20:56:39 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -1237,32 +1237,28 @@ static void autovacuum_do_vac_analyze(Oid relid, bool dovacuum, bool doanalyze, int freeze_min_age) { - VacuumStmt *vacstmt; + VacuumStmt vacstmt; MemoryContext old_cxt; /* - * The node must survive transaction boundaries, so make sure we create it + * The list must survive transaction boundaries, so make sure we create it * in a long-lived context */ old_cxt = MemoryContextSwitchTo(AutovacMemCxt); - vacstmt = makeNode(VacuumStmt); - /* Set up command parameters */ - vacstmt->vacuum = dovacuum; - vacstmt->full = false; - vacstmt->analyze = doanalyze; - vacstmt->freeze_min_age = freeze_min_age; - vacstmt->verbose = false; - vacstmt->relation = NULL; /* not used since we pass a relids list */ - vacstmt->va_cols = NIL; + vacstmt.vacuum = dovacuum; + vacstmt.full = false; + vacstmt.analyze = doanalyze; + vacstmt.freeze_min_age = freeze_min_age; + vacstmt.verbose = false; + vacstmt.relation = NULL; /* not used since we pass a relids list */ + vacstmt.va_cols = NIL; /* Let pgstat know what we're doing */ - autovac_report_activity(vacstmt, relid); - - vacuum(vacstmt, list_make1_oid(relid), true); + autovac_report_activity(&vacstmt, relid); - pfree(vacstmt); + vacuum(&vacstmt, list_make1_oid(relid), true); MemoryContextSwitchTo(old_cxt); } |