From: Julien Rouhaud <rjuju123@gmail.com>
To: torikoshia <torikoshia@oss.nttdata.com>
Cc: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: tgl@sss.pgh.pa.us, Bruce Momjian <bruce@momjian.us>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: RFC: Allow EXPLAIN to Output Page Fault Information
Date: Mon, 6 Jan 2025 17:59:02 +0800
Message-ID: <Z3upZkA5Bi6lYS6a@jrouhaud> (raw)
In-Reply-To: <1f22794321b745549d54359d343e37b8@oss.nttdata.com>
References: <c20f6340eb26f3b736abc59471bfada8@oss.nttdata.com>
<1614321.1735055528@sss.pgh.pa.us>
<D6MJOHS7HZ80.3B17NDGUV6T47@jeltef.nl>
<Z3LII9YEgp3kAZG-@momjian.us>
<3861403.1735576764@sss.pgh.pa.us>
<D6PENGW1PL79.266GQNPSMRIGA@jeltef.nl>
<1f22794321b745549d54359d343e37b8@oss.nttdata.com>
Hi,
On Mon, Jan 06, 2025 at 06:49:06PM +0900, torikoshia wrote:
>
> > **However, I think the general direction has merit**: Changing this
> > patch to
> > use `ru_inblock`/`ru_oublock` gives very useful insights. `ru_inblock`
> > is 0 when everything is in page cache, and it is very high when stuff is
> > not. I was only hacking around and basically did this:
> >
> > s/ru_minflt/ru_inblock/g
> > s/ru_majflt/ru_oublock/g
> > [...]
> > Also, maybe there's some better way
> > of getting read/write numbers for the current process than
> > ru_inblock/ru_oublock (but this one seems to work at least reasonably
> > well).
>
> Maybe, but as far as using getrusage(), ru_inblock and ru_outblock seem the
> best.
FWIW that's the counters we've been using in pg_stat_kcache / powa to compute
disk IO and "postgres shared buffers hit VS OS cache hit VS disk read" hit
ratio for many years and we didn't get any problem report for that.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: rjuju123@gmail.com, torikoshia@oss.nttdata.com, postgres@jeltef.nl, bruce@momjian.us
Subject: Re: RFC: Allow EXPLAIN to Output Page Fault Information
In-Reply-To: <Z3upZkA5Bi6lYS6a@jrouhaud>
References: <c20f6340eb26f3b736abc59471bfada8@oss.nttdata.com> <1614321.1735055528@sss.pgh.pa.us> <D6MJOHS7HZ80.3B17NDGUV6T47@jeltef.nl> <Z3LII9YEgp3kAZG-@momjian.us> <3861403.1735576764@sss.pgh.pa.us> <D6PENGW1PL79.266GQNPSMRIGA@jeltef.nl> <1f22794321b745549d54359d343e37b8@oss.nttdata.com> <Z3upZkA5Bi6lYS6a@jrouhaud>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox