Re: Add shared buffer hits to pg_stat_io
Melanie Plageman <melanieplageman@gmail.com>
From: Melanie Plageman <melanieplageman@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>, Maciek Sakrejda <m.sakrejda@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>,
smilingsamay@gmail.com, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Lukas Fittl <lukas@fittl.com>, Magnus Hagander <magnus@hagander.net>,
Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2023-03-08T18:44:32Z
Lists: pgsql-hackers
Attachments
- v3-0002-Track-shared-buffer-hits-in-pg_stat_io.patch (text/x-patch) patch v3-0002
- v3-0001-Reorder-pgstatfuncs-local-enum.patch (text/x-patch) patch v3-0001
On Tue, Mar 7, 2023 at 2:47 PM Andres Freund <andres@anarazel.de> wrote: > > Hi, > > LGTM. The only comment I have is that a small test wouldn't hurt... Compared > to the other things it should be fairly easy... So, I have attached an updated patchset which adds a test for hits. Since there is only one call site where we count hits, I think this single test is sufficient to protect against regressions. However, I am concerned that, while unlikely, this could be flakey. Something could happen to force all of those blocks out of shared buffers (even though they were just read in) before we hit them. We could simply check if hits are greater at the end of all of the pg_stat_io tests than at the beginning and rely on the fact that it is highly unlikely that every single buffer access will be a miss for all of the tests. However, is it not technically also possible to have zero hits? - Melanie
Commits
-
Track shared buffer hits in pg_stat_io
- 8aaa04b32d79 16.0 landed