Skip to content

Commit 066254c

Browse files
committed
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
1 parent 3f0e4be commit 066254c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,6 +2707,7 @@ MarkBufferDirtyHint(Buffer buffer, bool buffer_std)
27072707
if (dirtied)
27082708
{
27092709
VacuumPageDirty++;
2710+
pgBufferUsage.shared_blks_dirtied++;
27102711
if (VacuumCostActive)
27112712
VacuumCostBalance += VacuumCostPageDirty;
27122713
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy