Tom Lane wrote:
Hmm.  But if we're going to do that, we might as well have a checkpoint
for our troubles, no?  The reason for the current design is the
assumption that a bgwriter_all scan is less burdensome than a
checkpoint, but that is no longer true given this rewrite.

Per comments in CreateCheckPoint, another also skip the extra checkpoints to avoid writing two checkpoints to the same page, risking losing both on a crash:

         * If this isn't a shutdown or forced checkpoint, and we have not 
inserted
         * any XLOG records since the start of the last checkpoint, skip the
         * checkpoint.  The idea here is to avoid inserting duplicate 
checkpoints
         * when the system is idle. That wastes log space, and more importantly 
it
         * exposes us to possible loss of both current and previous checkpoint
         * records if the machine crashes just as we're writing the update.
         * (Perhaps it'd make even more sense to checkpoint only when the 
previous
         * checkpoint record is in a different xlog page?)

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to