I'm reading over the postgresql admin cookbook. Some of the database server parameters require a restart and with a busy database, you may need to restart quickly. There are a number of things to do to speed up restart: 1) issue a normal checkpoint before shutdown checkpoint, 2) flush all dirty shared_buffers to disk, 3) record the contents of the database cache prior to shutdown and then warm the cache again immediately after restart. Therefore, the book seems to recommend:
psql -c "CHECKPOINT"
psql -c "select pg_cache_save('mycache')"
pg_ctl -D datadir -m immediate restart
psql -c "select pg_cache_warm('mycache')"
It also showed this method to:
pg_ctl -D datadir restart -m fast
Which one should I use when restarting a busy database which gets inserts very often? One of the above or is there a better method?