1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Clean up a number of autovacuum loose ends. Make the stats collector

track shared relations in a separate hashtable, so that operations done
from different databases are counted correctly.  Add proper support for
anti-XID-wraparound vacuuming, even in databases that are never connected
to and so have no stats entries.  Miscellaneous other bug fixes.
Alvaro Herrera, some additional fixes by Tom Lane.
This commit is contained in:
Tom Lane
2005-07-29 19:30:09 +00:00
parent 507b758ad9
commit 5d5f1a79e6
13 changed files with 432 additions and 279 deletions

View File

@ -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 */