# pg_autoprewarm. This a PostgreSQL contrib module which automatically dump all of the blocknums present in buffer pool at the time of server shutdown(smart and fast mode only, to be enhanced to dump at regular interval.) and load these blocks when server restarts.
Design: ------ We have created a BG Worker Auto Pre-warmer which during shutdown dumps all the blocknum in buffer pool in sorted order. Format of each entry is <DatabaseId,TableSpaceId,RelationId,Forknum,BlockNum>. Auto Pre-warmer is started as soon as the postmaster is started we do not wait for recovery to finish and database to reach a consistent state. If there is a "dump_file" to load we start loading each block entry to buffer pool until there is a free buffer. This way we do not replace any new blocks which was loaded either by recovery process or querying clients. Then it waits until it receives SIGTERM to dump the block information in buffer pool. HOW TO USE: ----------- Build and add the pg_autoprewarm to shared_preload_libraries. Auto Pre-warmer process automatically do dumping of buffer pool's block info and load them when restarted. TO DO: ------ Add functionality to dump based on timer at regular interval. And some cleanups. -- Thanks and Regards Mithun C Y EnterpriseDB: http://www.enterprisedb.com
pg_autoprewarm_01.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers