doc: Add more details about pg_stat_get_xact_blocks_{fetched,hit}
authorMichael Paquier <[email protected]>
Tue, 4 Apr 2023 22:59:54 +0000 (07:59 +0900)
committerMichael Paquier <[email protected]>
Tue, 4 Apr 2023 22:59:54 +0000 (07:59 +0900)
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

doc/src/sgml/monitoring.sgml

index 5da26de30a0ff0d9f0792bfe748da0bc7272367f..01803dc53fffe84bd476adc3bbf0801ce0b0793c 100644 (file)
@@ -4615,8 +4615,11 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <returnvalue>bigint</returnvalue>
        </para>
        <para>
-        Returns the number of buffers fetched for table or index, in the current
-        transaction.
+        Returns the number of block read requests for table or index, in the
+        current transaction. This number minus
+        <function>pg_stat_get_xact_blocks_hit</function> gives the number of
+        kernel <function>read()</function> calls; the number of actual
+        physical reads is usually lower due to kernel-level buffering.
        </para></entry>
       </row>
 
@@ -4629,8 +4632,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <returnvalue>bigint</returnvalue>
        </para>
        <para>
-        Returns the number of buffer hits for table or index, in the current
-        transaction.
+        Returns the number of block read requests for table or index, in the
+        current transaction, found in cache (not triggering kernel
+        <function>read()</function> calls).
        </para></entry>
       </row>