aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/pgstat.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2007-03-28 22:17:12 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2007-03-28 22:17:12 +0000
commit7d4c9a5793b49633be0fae7653552f3fb4a812c0 (patch)
tree2a759c4c35e7d770cda3765df8972d5e9379338f /src/backend/postmaster/pgstat.c
parent685badd2136de6c2cc2330f8ddf2019912ed879f (diff)
downloadpostgresql-7d4c9a5793b49633be0fae7653552f3fb4a812c0.tar.gz
postgresql-7d4c9a5793b49633be0fae7653552f3fb4a812c0.zip
Add the "recheck" logic to autovacuum worker code. The worker first builds
its table list and then rechecks pgstat before vacuuming each table to verify that no one has vacuumed the table in the meantime. In the current autovacuum world this only means that a worker will not vacuum a table that a user has vacuumed manually after the worker started. When support for multiple autovacuum workers is introduced, this will reduce the probability of simultaneous workers on the same database doing redundant work.
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r--src/backend/postmaster/pgstat.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 26e6ff4ca08..fd19d5741c2 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.150 2007/03/22 19:53:30 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.151 2007/03/28 22:17:12 alvherre Exp $
* ----------
*/
#include "postgres.h"
@@ -2328,10 +2328,6 @@ pgstat_setup_memcxt(void)
void
pgstat_clear_snapshot(void)
{
- /* In an autovacuum worker process we keep the stats forever */
- if (IsAutoVacuumWorkerProcess())
- return;
-
/* Release memory, if any was allocated */
if (pgStatLocalContext)
MemoryContextDelete(pgStatLocalContext);