Skip to content

Conversation

@pierreforstmann
Copy link

Hello,

I have tried to adapt your code for PostgreSQL 16 (because in version 17 there is pg_buffercache_evict in pg_buffercache):

Currently I have following test case;


create extension pg_prewarm;
create extension pg_buffercache;
create extension pg_flushcache;

create table t ( a int, b text );
insert into t select i, i::text from generate_series(1,10000) i;
select pg_prewarm ( 't', 'buffer', 'main', null, null );

select pg_relation_filepath('t');
 pg_relation_filepath 
----------------------
 base/16385/16410
(1 row)

pierre=# select count(*) from pg_buffercache where relfilenode = 16410;
 count 
-------
    58
(1 row)

pierre=# select pg_drop_rel_cache(16410);
 pg_drop_rel_cache 
-------------------
 
(1 row)

pierre=# select count(*) from pg_buffercache where relfilenode = 16410;
 count 
-------
     4
(1 row)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant