]> granicus.if.org Git - postgresql/commitdiff
Make VACUUM VERBOSE report the number of skipped frozen pages.
authorFujii Masao <fujii@postgresql.org>
Fri, 24 Mar 2017 17:39:44 +0000 (02:39 +0900)
committerFujii Masao <fujii@postgresql.org>
Fri, 24 Mar 2017 17:39:44 +0000 (02:39 +0900)
Previously manual VACUUM did not report the number of skipped frozen
pages even when VERBOSE option is specified. But this information is
helpful to monitor the VACUUM activity, and also autovacuum reports that
number in the log file when the condition of log_autovacuum_min_duration
is met.

This commit changes VACUUM VERBOSE so that it reports the number
of frozen pages that it skips.

Author: Masahiko Sawada
Reviewed-by: Yugo Nagata and Jim Nasby
Discussion: http://postgr.es/m/CAD21AoDZQKCxo0L39Mrq08cONNkXQKXuh=2DP1Q8ebmt35SoaA@mail.gmail.com

doc/src/sgml/ref/vacuum.sgml
src/backend/commands/vacuumlazy.c

index 543ebcf6493754eb2ba90a9570110394d0f6c42d..8ec5b40b71bd6921cd056102b614fca045d84943 100644 (file)
@@ -273,7 +273,7 @@ DETAIL:  CPU: user: 0.06 s, system: 0.01 s, elapsed: 0.07 s.
 INFO:  "onek": found 3000 removable, 1000 nonremovable tuples in 143 pages
 DETAIL:  0 dead tuples cannot be removed yet.
 There were 0 unused item pointers.
-Skipped 0 pages due to buffer pins.
+Skipped 0 pages due to buffer pins, 0 frozen pages.
 0 pages are entirely empty.
 CPU: user: 0.39 s, system: 0.07 s, elapsed: 1.56 s.
 INFO:  analyzing "public.onek"
index b74e4934ec7b713e14b8d2e7b38f36fa668ff73c..5b43a66bdc91a6bfe5def1eb7fffbf780060a340 100644 (file)
@@ -1341,10 +1341,14 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats,
                                         nkeep, OldestXmin);
        appendStringInfo(&buf, _("There were %.0f unused item pointers.\n"),
                                         nunused);
-       appendStringInfo(&buf, ngettext("Skipped %u page due to buffer pins.\n",
-                                                                       "Skipped %u pages due to buffer pins.\n",
+       appendStringInfo(&buf, ngettext("Skipped %u page due to buffer pins",
+                                                                       "Skipped %u pages due to buffer pins",
                                                                        vacrelstats->pinskipped_pages),
                                         vacrelstats->pinskipped_pages);
+       appendStringInfo(&buf, ngettext("%u frozen page.\n",
+                                                                       "%u frozen pages.\n",
+                                                                       vacrelstats->frozenskipped_pages),
+                                        vacrelstats->frozenskipped_pages);
        appendStringInfo(&buf, ngettext("%u page is entirely empty.\n",
                                                                        "%u pages are entirely empty.\n",
                                                                        empty_pages),