diff options
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/analyze.c | 11 | ||||
-rw-r--r-- | src/backend/commands/vacuum.c | 16 | ||||
-rw-r--r-- | src/backend/commands/vacuumlazy.c | 6 |
3 files changed, 19 insertions, 14 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 03783f121e2..bd32c8c841e 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.87 2005/07/14 05:13:39 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.88 2005/07/29 19:30:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -317,7 +317,9 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt) * a zero-column table. */ if (!vacstmt->vacuum) - pgstat_report_analyze(RelationGetRelid(onerel), 0, 0); + pgstat_report_analyze(RelationGetRelid(onerel), + onerel->rd_rel->relisshared, + 0, 0); vac_close_indexes(nindexes, Irel, AccessShareLock); relation_close(onerel, AccessShareLock); @@ -436,8 +438,9 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt) } /* report results to the stats collector, too */ - pgstat_report_analyze(RelationGetRelid(onerel), totalrows, - totaldeadrows); + pgstat_report_analyze(RelationGetRelid(onerel), + onerel->rd_rel->relisshared, + totalrows, totaldeadrows); } /* Done with indexes */ diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 23b0911e8cc..9db91209448 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.311 2005/07/14 05:13:39 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.312 2005/07/29 19:30:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -41,6 +41,7 @@ #include "tcop/pquery.h" #include "utils/acl.h" #include "utils/builtins.h" +#include "utils/flatfiles.h" #include "utils/fmgroids.h" #include "utils/inval.h" #include "utils/lsyscache.h" @@ -490,7 +491,7 @@ vacuum(VacuumStmt *vacstmt, List *relids) * If it was a database-wide VACUUM, print FSM usage statistics * (we don't make you be superuser to see these). */ - if (vacstmt->relation == NULL) + if (all_rels) PrintFreeSpaceMapStatistics(elevel); /* @@ -712,7 +713,7 @@ vac_update_relstats(Oid relid, BlockNumber num_pages, double num_tuples, * vac_update_dbstats() -- update statistics for one database * * Update the whole-database statistics that are kept in its pg_database - * row. + * row, and the flat-file copy of pg_database. * * We violate no-overwrite semantics here by storing new values for the * statistics columns directly into the tuple that's already on the page. @@ -721,8 +722,6 @@ vac_update_relstats(Oid relid, BlockNumber num_pages, double num_tuples, * * This routine is shared by full and lazy VACUUM. Note that it is only * applied after a database-wide VACUUM operation. - * - * Note that we don't bother to update the flat-file copy of pg_database. */ static void vac_update_dbstats(Oid dbid, @@ -768,6 +767,9 @@ vac_update_dbstats(Oid dbid, heap_endscan(scan); heap_close(relation, RowExclusiveLock); + + /* Mark the flat-file copy of pg_database for update at commit */ + database_file_update_needed(); } @@ -1165,8 +1167,8 @@ full_vacuum_rel(Relation onerel, VacuumStmt *vacstmt) vacrelstats->rel_tuples, vacrelstats->hasindex); /* report results to the stats collector, too */ - pgstat_report_vacuum(RelationGetRelid(onerel), vacstmt->analyze, - vacrelstats->rel_tuples); + pgstat_report_vacuum(RelationGetRelid(onerel), onerel->rd_rel->relisshared, + vacstmt->analyze, vacrelstats->rel_tuples); } diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index 64cab8bbca4..179d35b4028 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -31,7 +31,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.55 2005/07/14 05:13:40 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.56 2005/07/29 19:30:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -182,8 +182,8 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt) hasindex); /* report results to the stats collector, too */ - pgstat_report_vacuum(RelationGetRelid(onerel), vacstmt->analyze, - vacrelstats->rel_tuples); + pgstat_report_vacuum(RelationGetRelid(onerel), onerel->rd_rel->relisshared, + vacstmt->analyze, vacrelstats->rel_tuples); } |