Commit 9eb344fa authored by Simon Riggs's avatar Simon Riggs

Allow vacuums to report oldestxmin

Allow VACUUM and Autovacuum to report the oldestxmin value they
used while cleaning tables, helping to make better sense out of
the other statistics we report in various cases.
parent 19dc233c
...@@ -380,10 +380,11 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params, ...@@ -380,10 +380,11 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
vacrelstats->pinskipped_pages, vacrelstats->pinskipped_pages,
vacrelstats->frozenskipped_pages); vacrelstats->frozenskipped_pages);
appendStringInfo(&buf, appendStringInfo(&buf,
_("tuples: %.0f removed, %.0f remain, %.0f are dead but not yet removable\n"), _("tuples: %.0f removed, %.0f remain, %.0f are dead but not yet removable, oldest xmin: %u\n"),
vacrelstats->tuples_deleted, vacrelstats->tuples_deleted,
vacrelstats->new_rel_tuples, vacrelstats->new_rel_tuples,
vacrelstats->new_dead_tuples); vacrelstats->new_dead_tuples,
OldestXmin);
appendStringInfo(&buf, appendStringInfo(&buf,
_("buffer usage: %d hits, %d misses, %d dirtied\n"), _("buffer usage: %d hits, %d misses, %d dirtied\n"),
VacuumPageHit, VacuumPageHit,
...@@ -1329,8 +1330,8 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, ...@@ -1329,8 +1330,8 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats,
*/ */
initStringInfo(&buf); initStringInfo(&buf);
appendStringInfo(&buf, appendStringInfo(&buf,
_("%.0f dead row versions cannot be removed yet.\n"), _("%.0f dead row versions cannot be removed yet, oldest xmin: %u\n"),
nkeep); nkeep, OldestXmin);
appendStringInfo(&buf, _("There were %.0f unused item pointers.\n"), appendStringInfo(&buf, _("There were %.0f unused item pointers.\n"),
nunused); nunused);
appendStringInfo(&buf, ngettext("Skipped %u page due to buffer pins.\n", appendStringInfo(&buf, ngettext("Skipped %u page due to buffer pins.\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment