pg_stat_io clarifications: background worker, writes and reads

From: Dimitrios Apostolou <jimis(at)gmx(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: pg_stat_io clarifications: background worker, writes and reads
Date: 2024-05-14 20:26:22
Message-ID: 2e9b2b7b-79a1-a7f2-e05e-9cefda601c09@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello list,

what is the "background worker" in the pg_stat_io statistics view? I'm
reading the documentation but can't figure this one out knowing that it is
not autovacuum or bgwriter. And I'm not aware of any extension I might
have with registered background worker.

Additionally, how can it be evictions > writes? I would expect every
eviction to cause a write.

Finally about "hits", I understand they are reads found in shared_buffers,
so they never registered into the "reads" counter. So is "reads" in
pg_stat_io the equivalent to misses, i.e. the opposite of "hits", the read
attempts not found in the shared_buffers, that needed to be fetched from
the disk (or OS buffercache)?

backend_type | object | context | reads | read_time | writes | write_time | writebacks | writeback_time | extends | extend_time | op_bytes | hits | evictions | reuses | fsyncs | fsync_time | stats_reset
-------------------+---------------+---------+---------+-------------+--------+------------+------------+----------------+---------+-------------+----------+-----------+-----------+--------+--------+------------+-------------------------------
background worker | relation | normal | 5139575 | 2196288.011 | 63277 | 1766.94 | 0 | 0 | 0 | 0 | 8192 | 876913705 | 5139653 | | 0 | 0 | 2024-04-08 08:50:02.971192+00

Thank you in advance,
Dimitris

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2024-05-14 20:45:21 Re: Using ALTER TABLE DETACH PARTITION CONCURRENTLY inside a procedure
Previous Message Dirschel, Steve 2024-05-14 20:24:49 Using ALTER TABLE DETACH PARTITION CONCURRENTLY inside a procedure