Re: Extension Enhancement: Buffer Invalidation in pg_buffercache - Mailing list pgsql-hackers

From Cédric Villemain
Subject Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Date
Msg-id 063eb0c5-2b3a-4708-83d5-d51b07085d3f@abcsql.com
Whole thread Raw
In response to Re: Extension Enhancement: Buffer Invalidation in pg_buffercache  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
Le 01/07/2023 à 00:09, Thomas Munro a écrit :
> On Fri, Jun 30, 2023 at 10:47 PM Palak Chaturvedi
> <chaturvedipalak1911@gmail.com> wrote:

> We also talked a bit about how one might control the kernel page cache
> in more fine-grained ways for testing purposes, but it seems like the
> pgfincore project has that covered with its pgfadvise_willneed() and
> pgfadvise_dontneed().  IMHO that project could use more page-oriented
> operations (instead of just counts and coarse grains operations) but
> that's something that could be material for patches to send to the
> extension maintainers.  This work, in contrast, is more tangled up
> with bufmgr.c internals, so it feels like this feature belongs in a
> core contrib module.

Precisely what pgfincore is doing/offering already.
Happy to propose to postgresql tree if there are interest. Next step for 
pgfincore is to add cachestat() syscall and evaluates benefits for 
PostgreSQL cost estimators of this new call.

Here an example to achieve the warm/unwarm, each bit is a PostgreSQL 
page, so here we warm cache with the first 3 and remove the last 3 from 
cache (system cache, not shared buffers).

-- Loading and Unloading
cedric=# select * from pgfadvise_loader('pgbench_accounts', 0, true, 
true, B'111000');
      relpath      | os_page_size | os_pages_free | pages_loaded | 
pages_unloaded
------------------+--------------+---------------+--------------+----------------
  base/11874/16447 |         4096 |        408376 |            3 | 
        3


---
Cédric Villemain +33 (0)6 20 30 22 52
https://Data-Bene.io
PostgreSQL Expertise, Support, Training, R&D



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: autovectorize page checksum code included elsewhere
Next
From: John Naylor
Date:
Subject: Re: Output affected rows in EXPLAIN