diff options
| author | Heikki Linnakangas | 2008-12-17 09:15:03 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2008-12-17 09:15:03 +0000 |
| commit | dcf8409985f4db00bfb4c365792e39b70688318e (patch) | |
| tree | 861a18486b7ed9b3ab02074502aa905bcaa03a8c /src/include | |
| parent | 5a90bc1fbe829e04d319388b54b76c7a0fe36b58 (diff) | |
Don't reset pg_class.reltuples and relpages in VACUUM, if any pages were
skipped. We could update relpages anyway, but it seems better to only
update it together with reltuples, because we use the reltuples/relpages
ratio in the planner. Also don't update n_live_tuples in pgstat.
ANALYZE in VACUUM ANALYZE now needs to update pg_class, if the
VACUUM-phase didn't do so. Added some boolean-passing to let analyze_rel
know if it should update pg_class or not.
I also moved the relcache invalidation (to update rd_targblock) from
vac_update_relstats to where RelationTruncate is called, because
vac_update_relstats is not called for partial vacuums anymore. It's more
obvious to send the invalidation close to the truncation that requires it.
Per report by Ned T. Crigler.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/commands/vacuum.h | 6 | ||||
| -rw-r--r-- | src/include/pgstat.h | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index 90446bc4f5..153dbb37f2 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/vacuum.h,v 1.81 2008/11/10 00:49:37 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/vacuum.h,v 1.82 2008/12/17 09:15:03 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -144,10 +144,10 @@ extern void vacuum_delay_point(void); /* in commands/vacuumlazy.c */ extern void lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt, - BufferAccessStrategy bstrategy); + BufferAccessStrategy bstrategy, bool *scanned_all); /* in commands/analyze.c */ extern void analyze_rel(Oid relid, VacuumStmt *vacstmt, - BufferAccessStrategy bstrategy); + BufferAccessStrategy bstrategy, bool update_reltuples); #endif /* VACUUM_H */ diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 119d7b6966..d2e218ea9c 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -5,7 +5,7 @@ * * Copyright (c) 2001-2008, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.79 2008/11/03 01:17:08 tgl Exp $ + * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.80 2008/12/17 09:15:03 heikki Exp $ * ---------- */ #ifndef PGSTAT_H @@ -284,6 +284,7 @@ typedef struct PgStat_MsgVacuum Oid m_tableoid; bool m_analyze; bool m_autovacuum; + bool m_scanned_all; TimestampTz m_vacuumtime; PgStat_Counter m_tuples; } PgStat_MsgVacuum; @@ -631,7 +632,7 @@ extern void pgstat_clear_snapshot(void); extern void pgstat_reset_counters(void); extern void pgstat_report_autovac(Oid dboid); -extern void pgstat_report_vacuum(Oid tableoid, bool shared, +extern void pgstat_report_vacuum(Oid tableoid, bool shared, bool scanned_all, bool analyze, PgStat_Counter tuples); extern void pgstat_report_analyze(Relation rel, PgStat_Counter livetuples, |
