In working with s a client to analyze their temp file usage, it became useful to know when a temporary file was created
aswell as when it was closed. That way, we could process the logs to determine a high water mark of overall temp file
usage,to know how high it was safe (in that workload) to set work_mem. So, I wrote a quick patch that logged both the
openand close of the temp file.
Since the final size of the file isn't known at the time that the file is created, the patch just logs the filename.
Theparticular file can be correlated with the size by the name when the close message is logged. Of course, there's no
informationabout the pattern of the file size over time, but it's a bit more information than was there before.
As we don't know the size of the file until close time, the open is only logged if log_temp_files is 0 (the idea being
that's"maximum logging").
If this sounds like something worthwhile in general, I can package it up as a proper patch.
--
-- Christophe Pettus xof@thebuild.com