1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Track shared buffer hits in pg_stat_io

Among other things, this should make it easier to calculate a useful cache hit
ratio by excluding buffer reads via buffer access strategies. As buffer access
strategies reuse buffers (and thus evict the prior buffer contents), it is
normal to see reads on repeated scans of the same data.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CAAKRu_beMa9Hzih40%3DXPYqhDVz6tsgUGTrhZXRo%3Dunp%2Bszb%3DUA%40mail.gmail.com
This commit is contained in:
Andres Freund
2023-03-30 19:22:40 -07:00
parent 6c3b697b19
commit 8aaa04b32d
12 changed files with 109 additions and 47 deletions

View File

@ -3855,6 +3855,17 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
</entry>
</row>
<row>
<entry role="catalog_table_entry">
<para role="column_definition">
<structfield>hits</structfield> <type>bigint</type>
</para>
<para>
The number of times a desired block was found in a shared buffer.
</para>
</entry>
</row>
<row>
<entry role="catalog_table_entry">
<para role="column_definition">