Table of Contents
PostgreSQL – Manage Crash recovery time
Though database is designed to be up and running always but incidents do happen. In case database get crashed, we should ensure that it will be up and running within agreed amount of time. We can control it by tuning checkpointing. Checkpoint ensures that changes till that point of time have already been written to data files. The PostgreSQL parameter to control it is checkpoint_timeout. It’s default value is 5 mins. Having an aggressive checkpoint may have performance impact . Thus, the best thing is to have a balance between performance and crash recovery time.
How to change checkpoint_timeout
you can set it in postgresql.conf or using alter system set checkpoint_timeout=600
if no unit is specified, then unit will be seconds. It’s valid range is from 30 sec to 1 day.
If you are preparing for PostgreSQL database interview , Please check useful questions here.
If you want to crack an interview for the PostgreSQL DBA/Database Engineer role, a demo interview will fortify your chances. Book an interview preparation session.