Re: Add os_page_num to pg_buffercache

Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Tomas Vondra <tomas@vondra.me>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-01T13:45:55Z
Lists: pgsql-hackers

Attachments

Hi,

On Thu, Apr 10, 2025 at 03:05:29PM +0000, Bertrand Drouvot wrote:
> Hi,
> 
> On Thu, Apr 10, 2025 at 09:58:18AM -0500, Nathan Bossart wrote:
> > On Thu, Apr 10, 2025 at 03:35:24PM +0200, Tomas Vondra wrote:
> > > This seems like a good idea in principle, but at this point it has to
> > > wait for PG19. Please add it to the July commitfest.
> > 
> > +1.  From a glance, this seems to fall in the "new feature" bucket and
> > should likely wait for v19.
> 
> Thank you both for providing your thoughts that confirm my initial doubt. Let's
> come back to that one later then.
> 

Here we are.

Please find attached a rebased version and while at it, v2 adds a new macro and
a function to avoid some code duplication between pg_buffercache_pages() and
pg_buffercache_numa_pages().

So, PFA:

0001 - Introduce GET_MAX_BUFFER_ENTRIES and get_buffer_page_boundaries

Those new macro and function are extracted from pg_buffercache_numa_pages() and
pg_buffercache_numa_pages() makes use of them.

0002 - Add os_page_num to pg_buffercache

Making use of the new macro and function from 0001.

As it's for v19, also bumping pg_buffercache's version to 1.7.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Commits

  1. pg_buffercache: Add pg_buffercache_os_pages

  2. doc: Fix style of description for pg_buffercache_numa.os_page_num

  3. Add CHECK_FOR_INTERRUPTS in contrib/pg_buffercache functions.

  4. pg_walsummary: Improve stability of test checking statistics