monitoring-stats.html documentation

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: monitoring-stats.html documentation
Date: 2009-04-04 21:13:13
Message-ID: 603c8f070904041413j5a1880f9u22bae2e7d56543f4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-04-04 22:08:01 Re: monitoring-stats.html documentation
Previous Message Tom Lane 2009-04-04 17:44:13 Re: GetCurrentVirtualXIDs()