>>> On Wed, Sep 26, 2007 at  3:14 PM, in message
> The logic for zeroing the blocks makes me nervous. It doesn't locate the
> block from which to start, it treats all blocks equally, so might zero
> some blocks and not others. What you have should work, but I'd be
> inclined to put a test in there to check that doesn't happen: once we
> begin to zero pages, all of them should be zeroed to end of file. If we
> find one that shouldn't be zeroed, throw an error.
> We should also document that this is designed to help compress files
> that aren't full because we switched early because of archive_timeout.
Attached is a modified version to implement both of these.  I also bailed
out if there was surplus input.  I tried an optimization of allocating a
separate buffer for outputting the zeros, to avoid repeated memset calls.
It didn't seem to make a very big difference; do you think it's worth
cluttering the code with that?

Attachment: pg_clearxlogtail.c
Description: Binary data

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to