blks_read/blks_hit stats

Поиск
Список
Период
Сортировка
От Nigel Heron
Тема blks_read/blks_hit stats
Дата
Msg-id 4DF8DFF7.10708@psycode.com
обсуждение исходный текст
Ответы Re: blks_read/blks_hit stats  (Nigel Heron <nigel@psycode.com>)
Список pgsql-general
Hi everyone,

I'm playing with the stats views and functions to graph them in cacti..
Adding up *_blks_hit (heap, idx, toast and tidx) from pg_statio doesn't
match blks_hit in pg_stat_database.
Sometimes the sum is higher, sometimes lower. Do they have similar names
but represent different metrics?
Same issue with blks_read.

eg.
SELECT
SUM(pg_statio_all_tables.heap_blks_hit)::bigint +
SUM(pg_statio_all_tables.idx_blks_hit)::bigint +
SUM(pg_statio_all_tables.toast_blks_hit)::bigint +
SUM(pg_statio_all_tables.tidx_blks_hit)::bigint AS blks_hit
FROM pg_statio_all_tables;
   blks_hit
------------
  1275299563
(1 row)


SELECT blks_hit
FROM pg_stat_database
where datname='mydb';
   blks_hit
-----------
  674295210
(1 row)


here's 2 graphs from different databases on the same cluster (8.4.2).
first 4 stacked graph items are from pg_statio_all_tables and the red
line is from pg_stat_database.

blks_hit is way under the sum:
<http://www.psycode.com/gallery/d/88438-1/blks_read1.png>
blks_hit seems pretty close to the sum of table+idx (but no toast):
<http://www.psycode.com/gallery/d/88440-1/blks_read2.png>


thanks,
-nigel.


В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Setting up tablepace
Следующее
От: "Anibal David Acosta"
Дата:
Сообщение: pgadmin "Running VACUUM recommended"