monitoring-stats.html documentation - Mailing list pgsql-hackers

From Robert Haas
Subject monitoring-stats.html documentation
Date
Msg-id 603c8f070904041413j5a1880f9u22bae2e7d56543f4@mail.gmail.com
Whole thread Raw
Responses Re: monitoring-stats.html documentation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
http://developer.postgresql.org/pgdocs/postgres/monitoring-stats.html
says: "Note: blocks_fetched minus blocks_hit gives the number of
kernel read() calls issued for the table, index, or database; but the
actual number of physical reads is usually lower due to kernel-level
buffering."  This seems to imply that anything that increases
blocks_hit should also increase blocks_fetched, but that doesn't seem
to match the actual behavior.

rhaas=# select heap_blks_read, heap_blks_hit from pg_statio_user_tables;heap_blks_read | heap_blks_hit
----------------+---------------          4356 |          5618
(1 row)

rhaas=# select sum(1) from foo; sum
--------100000
(1 row)

rhaas=# select heap_blks_read, heap_blks_hit from pg_statio_user_tables;heap_blks_read | heap_blks_hit
----------------+---------------          4356 |          6354
(1 row)

Obviously, if the note above were correct then (1) the number of
read() calls issue by the kernel would be negative and (2) accessing
the relation when it is fully cached would decreases the number of
read() calls previously issued.

...Robert


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: GetCurrentVirtualXIDs()
Next
From: Tom Lane
Date:
Subject: Re: monitoring-stats.html documentation