Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-12 Thread Guillaume Smet
Hi all, Sorry for arriving so late into the discussion. I don't know if it's possible but it could be useful to have the text of the query which required the creation of the temporary files as an additional DETAIL line. At least, if it's possible to have it in this part of the code. Thoughts?

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-11 Thread Simon Riggs
On Tue, 2007-01-09 at 17:16 -0500, Bruce Momjian wrote: Tom Lane wrote: /* reset flag so that die() interrupt won't cause problems */ vfdP-fdstate = ~FD_TEMPORARY; + PG_TRACE1(temp__file__cleanup, vfdP-fileName); +

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-11 Thread Bruce Momjian
Simon Riggs wrote: Also, I dunno much about DTrace, but I had the idea that you can't simply throw a PG_TRACE macro into the source and think you are done --- isn't there a file of probe declarations to add to? Not to mention the documentation of what probes exist. I didn't like

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-11 Thread Simon Riggs
On Thu, 2007-01-11 at 12:35 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: Tom Lane wrote: The TRACE is in the wrong place no? I thought it was going to be after the stat() operation so it could pass the file size. We had that discussion already. If you only pass it

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-09 Thread Bruce Momjian
Bill Moran wrote: In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] wrote: Might be more robust to say if (trace_temp_files = 0) I specified in the GUC config that minimum allowable value is -1. I'd still tend

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-09 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: + A value of zero logs all temporary files, and positive + values log only files whose size is equal or greater than + the specified number of bytes. Surely the measurement unit should be kbytes or disk blocks. And why aren't you

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-09 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: Surely the measurement unit should be kbytes or disk blocks. And why aren't you using that GUC UNITS infrastructure Peter put in? Agreed. I have applied the following patch to make it kilobytes, and documented it. I didn't put '-1kB'

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-09 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: Surely the measurement unit should be kbytes or disk blocks. And why aren't you using that GUC UNITS infrastructure Peter put in? Agreed. I have applied the following patch to make it kilobytes, and documented

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-09 Thread Bruce Momjian
Tom Lane wrote: Bill Moran [EMAIL PROTECTED] writes: In response to Tom Lane [EMAIL PROTECTED]: and then zero can be the off position, and we need not worry about whether -1 is -1 byte or -1 kbyte. All doing this does is make it impossible to log temp files of 1 byte. How you

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-05 Thread Jim Nasby
On Jan 3, 2007, at 4:20 PM, Bill Moran wrote: * trace_temp_files is now an int: -1 disables, 0 and up equate to log if the file is this size or larger Another thought is to allow ignoring files over a certain size. The reason is that if you end up creating 10MB of temp files, you can

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-04 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] wrote: Might be more robust to say if (trace_temp_files = 0) I specified in the GUC config that minimum allowable value is -1. I'd still tend to go with Andrew's suggestion because it makes this particular bit of code

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-04 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] wrote: Might be more robust to say if (trace_temp_files = 0) I specified in the GUC config that minimum allowable value is -1. I'd still tend to go with Andrew's

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-03 Thread Simon Riggs
On Tue, 2007-01-02 at 18:20 -0500, Tom Lane wrote: Bill Moran [EMAIL PROTECTED] writes: In response to Alvaro Herrera [EMAIL PROTECTED]: Please change things to save the stat() syscall when the feature is not in use. Do you have a suggestion on how to do that and still have the

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-03 Thread Bill Moran
In response to Simon Riggs [EMAIL PROTECTED]: On Tue, 2007-01-02 at 18:20 -0500, Tom Lane wrote: Bill Moran [EMAIL PROTECTED] writes: In response to Alvaro Herrera [EMAIL PROTECTED]: Please change things to save the stat() syscall when the feature is not in use. Do you have a

Re: [HACKERS] [PATCHES] Patch to log usage of temporary files

2007-01-02 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: In response to Alvaro Herrera [EMAIL PROTECTED]: Please change things to save the stat() syscall when the feature is not in use. Do you have a suggestion on how to do that and still have the PG_TRACE1() work? That was specifically requested by Simon