Re: Add shared buffer hits to pg_stat_io

2023-03-30 Thread Andres Freund
Hi, On 2023-03-09 08:23:46 -0500, Melanie Plageman wrote: > Good idea. v3 attached. I committed this, after some small regression test changes. I was worried that the query for testing buffer hits might silently change in the future, so I added an EXPLAIN for the query. Also removed the need for

Re: Add shared buffer hits to pg_stat_io

2023-03-09 Thread Drouvot, Bertrand
Hi, On 3/9/23 2:23 PM, Melanie Plageman wrote: On Wed, Mar 8, 2023 at 2:23 PM Andres Freund wrote: On 2023-03-08 13:44:32 -0500, Melanie Plageman wrote: However, I am concerned that, while unlikely, this could be flakey. Something could happen to force all of those blocks out of shared

Re: Add shared buffer hits to pg_stat_io

2023-03-09 Thread Melanie Plageman
On Wed, Mar 8, 2023 at 2:23 PM Andres Freund wrote: > > On 2023-03-08 13:44:32 -0500, Melanie Plageman wrote: > > 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

Re: Add shared buffer hits to pg_stat_io

2023-03-08 Thread Andres Freund
On 2023-03-08 13:44:32 -0500, Melanie Plageman wrote: > 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. You could make the test query a simple

Re: Add shared buffer hits to pg_stat_io

2023-03-08 Thread Melanie Plageman
On Tue, Mar 7, 2023 at 2:47 PM Andres Freund 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

Re: Add shared buffer hits to pg_stat_io

2023-03-07 Thread Andres Freund
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... Greetings, Andres Freund

Re: Add shared buffer hits to pg_stat_io

2023-03-07 Thread Drouvot, Bertrand
Hi, On 3/6/23 4:38 PM, Melanie Plageman wrote: Thanks for the review! On Tue, Feb 28, 2023 at 7:36 AM Drouvot, Bertrand wrote: BufferDesc * LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum, -bool *foundPtr, IOContext

Re: Add shared buffer hits to pg_stat_io

2023-03-06 Thread Melanie Plageman
Thanks for the review! On Tue, Feb 28, 2023 at 7:36 AM Drouvot, Bertrand wrote: > BufferDesc * > LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber > blockNum, > -bool *foundPtr, IOContext *io_context) > +bool

Re: Add shared buffer hits to pg_stat_io

2023-02-28 Thread Drouvot, Bertrand
Hi, On 2/25/23 9:16 PM, Melanie Plageman wrote: Hi, As suggested in [1], the attached patch adds shared buffer hits to pg_stat_io. Thanks for the patch! BufferDesc * LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum, -bool

Add shared buffer hits to pg_stat_io

2023-02-25 Thread Melanie Plageman
Hi, As suggested in [1], the attached patch adds shared buffer hits to pg_stat_io. I remember at some point having this in the view and then removing it but I can't quite remember what the issue was -- nor do I see a rationale mentioned in the thread [2]. It might have had something to do with