In working with s a client to analyze their temp file usage, it became useful 
to know when a temporary file was created as well 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 open and 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.  The particular file can be 
correlated with the size by the name when the close message is logged.  Of 
course, there's no information about 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
   x...@thebuild.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to