Re: Add shared buffer hits to pg_stat_io - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Add shared buffer hits to pg_stat_io
Date
Msg-id CAAKRu_ZBauWVzOGkjsM3dwLv5WQLfQA=Ht5=_raaBZ9kaaSPJw@mail.gmail.com
Whole thread Raw
In response to Re: Add shared buffer hits to pg_stat_io  (Andres Freund <andres@anarazel.de>)
Responses Re: Add shared buffer hits to pg_stat_io
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Add standard collation UNICODE
Next
From: Tom Lane
Date:
Subject: Re: proposal - get_extension_version function