作者
digoal
日期
2020-03-24
标签
PostgreSQL , drop , cache
背景
https://github.com/zilder/pg_dropcache
警告: 脏页也会直接drop, 所以可能会导致数据不一致. 别玩
Usage
WARNING: Dirty pages will be just dropped, therefore they won't be flushed on the disk! It should be used with extreme caution!
To clear whole buffer cache run:
select pg_dropcache();
To clear cache buffers for just a single relation:
select pg_drop_rel_cache(<relation>);
If you need to clear a specific buffer cache, you can specify it as second parameter:
select pg_drop_rel_cache(<relation>, <fork>);
fork can have one of the following values:
'main'
'vm'
'fsm'
'init'
Have fun!
PostgreSQL 许愿链接
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.