Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

From: Cédric Villemain <cedric(dot)villemain+pgsql(at)abcsql(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Palak Chaturvedi <chaturvedipalak1911(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Date: 2023-11-22 10:04:59
Message-ID: 063eb0c5-2b3a-4708-83d5-d51b07085d3f@abcsql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le 01/07/2023 à 00:09, Thomas Munro a écrit :
> On Fri, Jun 30, 2023 at 10:47 PM Palak Chaturvedi
> <chaturvedipalak1911(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2023-11-22 10:07:47 Re: Output affected rows in EXPLAIN
Previous Message John Naylor 2023-11-22 09:44:03 Re: autovectorize page checksum code included elsewhere