Re: Extension Enhancement: Buffer Invalidation in pg_buffercache
Cedric Villemain <cedric.villemain+pgsql@abcsql.com>
From: Cédric Villemain <cedric.villemain+pgsql@abcsql.com>
To: Thomas Munro <thomas.munro@gmail.com>,
Palak Chaturvedi <chaturvedipalak1911@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2023-11-22T10:04:59Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add pg_buffercache_evict() function for testing.
- 13453eedd3f6 17.0 landed
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