On 08/24/2011 11:12 AM, Martín Marqués wrote:
> Why aren't deltas good enough for the first 8Kb? Is there other
> information in the first 8Kb that make those more important?
>
The fundamental problem is what's called a torn page. You write out a
8K page; only part of it actually makes it to disk; the server crashes.
What you now have on disk is completely unpredictable. It's a mix of
the old new page, but what portion of each you got, that's almost
random. You cannot fix it with any delta. The only way to make sure
it's back into a good state is to write an entire 8K page, a known
correct copy, from some point in time.
The way this is done in PostgreSQL, one of those is written out to the
WAL the first time any page is touched after a checkpoint. Those become
the known copy good to recover from any torn page problem. Then
database recovery only has to replay activity since that checkpoint
marker to fix all torn pages.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us