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_2_9~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a63dda4c2a0bf06b8da28d15baae1a08e2e8fd5;p=thirdparty%2Fpostgresql.git 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 9b0283fa518..c60158d675f 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -2474,6 +2474,7 @@ SetBufferCommitInfoNeedsSave(Buffer buffer) { /* Do vacuum cost accounting */ VacuumPageDirty++; + pgBufferUsage.shared_blks_dirtied++; if (VacuumCostActive) VacuumCostBalance += VacuumCostPageDirty; }