On Thu, 30 Oct 2008, Kyle Cordes wrote:
It sure would be nice if there was a way for PG itself to zero the unused portion of logs as they are completed, perhaps this will make it in as part of the ideas discussed on this list a while back to make a more "out of the box" log-ship mechanism?
The overhead of clearing out the whole thing is just large enough that it can be disruptive on systems generating lots of WAL traffic, so you don't want the main database processes bothering with that. A related fact is that there is a noticable slowdown to clients that need a segment switch on a newly initialized and fast system that has to create all its WAL segments, compared to one that has been active long enough to only be recycling them. That's why this sort of thing has been getting pushed into the archive_command path; nothing performance-sensitive that can slow down clients is happening there, so long as your server is powerful enough to handle that in parallel with everything else going on.
Now, it would be possible to have that less sensitive archive code path zero things out, but you'd need to introduce a way to note when it's been done (so you don't do it for a segment twice) and a way to turn it off so everybody doesn't go through that overhead (which probably means another GUC). That's a bit much trouble to go through just for a feature with a fairly limited use-case that can easily live outside of the engine altogether.
-- * Greg Smith gsmith@xxxxxxxxxxxxx http://www.gregsmith.com Baltimore, MD -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general