]> granicus.if.org Git - postgresql/commitdiff
Count buffers dirtied due to hints in pgBufferUsage.shared_blks_dirtied.
authorRobert Haas <rhaas@postgresql.org>
Mon, 31 Mar 2014 17:06:26 +0000 (13:06 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 31 Mar 2014 17:06:26 +0000 (13:06 -0400)
Previously, such buffers weren't counted, with the possible result that
EXPLAIN (BUFFERS) and pg_stat_statements would understate the true
number of blocks dirtied by an SQL statement.

Back-patch to 9.2, where this counter was introduced.

Amit Kapila

src/backend/storage/buffer/bufmgr.c

index 19eecab4c2862b7ee880b3eb07d6559c679d930f..4e46ddbba29c19daee7483684cbaf2c65303e52c 100644 (file)
@@ -2707,6 +2707,7 @@ MarkBufferDirtyHint(Buffer buffer, bool buffer_std)
                if (dirtied)
                {
                        VacuumPageDirty++;
+                       pgBufferUsage.shared_blks_dirtied++;
                        if (VacuumCostActive)
                                VacuumCostBalance += VacuumCostPageDirty;
                }