* Peter Eisentraut (peter.eisentr...@2ndquadrant.com) wrote: > On 1/19/17 9:53 AM, Stephen Frost wrote: > > Sure, but we're talking about replaying WAL vs. doing a checkpoint, not > > about writing WAL vs. replaying WAL. Replaying WAL and doing a > > checkpoint both require writing to lots of different places across the > > filesystem, of course. > > Yeah, but they are each doing different things, so you can't say that > one will take the same amount of time or strictly less than the other. > It might be a good first estimation, but my practical experience is that > it's not when it really matters. :-/
You've found that WAL replay following a crash takes longer than checkpointing and therefore crash recovery requires more time than checkpoint_timeout is set to? WAL replay does do more work, generally speaking (the WAL has to be read, the checksum validated on it, and then the write has to go out, while the checkpointer just writes the page out from memory), but it's also dealing with less contention on the system (there aren't a bunch of backends hammering the disks to pull data in with reads when you're doing crash recovery...). We did make the WAL checksum routines a lot faster with 9.6, as I recall, so perhaps there's been some change there too. Thanks! Stephen
signature.asc
Description: Digital signature