Skip to content

Commit 1372166

Browse files
committed
doc: Add more details about pg_stat_get_xact_blocks_{fetched,hit}
The explanation describing the dependency to system read() calls for these two functions has been removed in ddfc2d9. And after more discussion about d69c404, we have concluded that adding more details makes them easier to understand. While on it, use the term "block read requests" (maybe found in cache) rather than "buffers fetched" and "buffer hits". Per discussion with Melanie Plageman, Kyotaro Horiguchi, Bertrand Drouvot and myself. Discussion: https://postgr.es/m/CAAKRu_ZmdiScT4q83OAbfmR5AH-L5zWya3SXjaxiJvhCob-e2A@mail.gmail.com Backpatch-through: 11
1 parent e8d74aa commit 1372166

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/src/sgml/monitoring.sgml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3296,17 +3296,21 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
32963296
<entry><literal><function>pg_stat_get_xact_blocks_fetched</function>(oid)</literal><indexterm><primary>pg_stat_get_xact_blocks_fetched</primary></indexterm></entry>
32973297
<entry><type>bigint</type></entry>
32983298
<entry>
3299-
Returns the number of buffers fetched for table or index, in the current
3300-
transaction.
3299+
Returns the number of block read requests for table or index, in the
3300+
current transaction. This number minus
3301+
<function>pg_stat_get_xact_blocks_hit</function> gives the number of
3302+
kernel <function>read()</function> calls; the number of actual
3303+
physical reads is usually lower due to kernel-level buffering.
33013304
</entry>
33023305
</row>
33033306

33043307
<row>
33053308
<entry><literal><function>pg_stat_get_xact_blocks_hit</function>(oid)</literal><indexterm><primary>pg_stat_get_xact_blocks_hit</primary></indexterm></entry>
33063309
<entry><type>bigint</type></entry>
33073310
<entry>
3308-
Returns the number of buffer hits for table or index, in the current
3309-
transaction.
3311+
Returns the number of block read requests for table or index, in the
3312+
current transaction, found in cache (not triggering kernel
3313+
<function>read()</function> calls).
33103314
</entry>
33113315
</row>
33123316

0 commit comments

Comments
 (0)