1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-21 15:54:08 +03:00

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
This commit is contained in:
Robert Haas 2014-03-31 13:06:26 -04:00
parent 8c1797e59b
commit 6a63dda4c2

View File

@ -2474,6 +2474,7 @@ SetBufferCommitInfoNeedsSave(Buffer buffer)
{ {
/* Do vacuum cost accounting */ /* Do vacuum cost accounting */
VacuumPageDirty++; VacuumPageDirty++;
pgBufferUsage.shared_blks_dirtied++;
if (VacuumCostActive) if (VacuumCostActive)
VacuumCostBalance += VacuumCostPageDirty; VacuumCostBalance += VacuumCostPageDirty;
} }