On Tue, 2010-04-20 at 21:03 -0400, Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > Following patch writes a new WAL record that just says "copy foo to
> > newts" and during replay we flush buffers and then re-execute the copy
> > (but only when InArchiveRecovery). So the copy happens locally on the
> > standby, not copying from primary to standby. We do this just with a
> > little refactoring and a simple new WAL message.
>
> And what happens to crash-recovery replay? You can't have it both ways,
> either the data is in WAL or it's missing.
The patch changes nothing in the case of crash recovery.
There is no WAL written if !XLogIsNeeded, so we *must* have already made
the decision that the absence of WAL is not a problem for crash
recovery. Note that currently we flush the new table to disk just like
we do for heap_sync(), whether or not WAL is written.
> > Objections?
>
> This is NOT the time to be rushing in marginal performance
> optimizations. I don't think you've thought through all the corner
> cases anyway.
The performance gain isn't marginal, otherwise I wouldn't have bothered
writing it
* We avoid writing GB of unnecessary WAL data on primary
* We avoid streaming that WAL data to the standby
If you can see a corner case that I do not, please say.
-- Simon Riggs www.2ndQuadrant.com