
> I just had an idea about how to avoid this cost:
> why not recycle old log segments?  At the point where the code
> currently deletes a no-longer-needed segment, just rename it to
> become the next created-in-advance segment.

Yes, since I already suggested this on Feb 26. I naturally think this 
is a good idea, iirc Vadim also stated similar ideas.

http://fts.postgresql.org/db/mw/msg.html?mid=73076

Maybe I did not make myself clear enough though, you clearly did better :-)

> Another issue is whether the recycling logic should be "always recycle"
> (hence number of extant WAL segments will never decrease), or should
> it be more like "recycle if there are fewer than WAL_FILES advance
> segments, else delete".

Yes, I think we should use the WAL_FILES parameter to state how many WAL files
should be kept around, or better yet only use it if it is not 0.
Thus the default would be to never decrease, but if the admin went to the 
trouble of specifying a (good) value, that should imho be honored.

Andreas

Wed, 18 Jul 2001 10:14:28 +0200
Zeugswetter Andreas SB  <ZeugswetterA@wien.spardat.at>
AW: Idea: recycle WAL segments, don't delete/recreate '
	em
Zeugswetter Andreas SB  <ZeugswetterA@wien.spardat.at> writes:
> Yes, since I already suggested this on Feb 26.

So you did.  Darn, I thought it was original ;-)

			regards, tom lane

Wed, 18 Jul 2001 11:09:46 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: AW: Idea: recycle WAL segments, don't delete/recreate ' em 