Re: Add os_page_num to pg_buffercache

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add os_page_num to pg_buffercache
Date: 2025-07-01 13:45:55
Message-ID: aGPmk2l++OU0KmYj@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v2-0001-Introduce-GET_MAX_BUFFER_ENTRIES-and-get_buffer_p.patch text/x-diff 3.6 KB
v2-0002-Add-os_page_num-to-pg_buffercache.patch text/x-diff 13.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-07-01 13:57:18 Re: Optimize LWLock scalability via ReadBiasedLWLock for heavily-shared locks
Previous Message Amit Langote 2025-07-01 13:42:06 Re: Proposal: Global Index for PostgreSQL