From: Robert Haas Date: Mon, 31 Mar 2014 17:06:26 +0000 (-0400) Subject: Count buffers dirtied due to hints in pgBufferUsage.shared_blks_dirtied. X-Git-Tag: REL9_3_5~130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac2063ade566deb03e72e3da52cf472e125708b7;p=postgresql Count buffers dirtied due to hints in pgBufferUsage.shared_blks_dirtied. 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 --- diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index a5e97c761d..f2f42659c1 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -2708,6 +2708,7 @@ MarkBufferDirtyHint(Buffer buffer, bool buffer_std) if (dirtied) { VacuumPageDirty++; + pgBufferUsage.shared_blks_dirtied++; if (VacuumCostActive) VacuumCostBalance += VacuumCostPageDirty; }