Re: [pgsql-patches] [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?

--
Guillaume

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [pgsql-patches] [PATCHES] Patch to log usage of temporary

2007-01-12 Thread Bruce Momjian
Guillaume Smet wrote:
 On 1/12/07, Bruce Momjian [EMAIL PROTECTED] wrote:
  Usually people don't want th query unless they ask for it.  One nify
  trick would be to print the query as DETAIL unless they are already
  logging queries, but that just seems too complex.  If you want the
  query, why not just log them all?
 
 Because they can't? On a highly loaded production server, people
 usually don't log all the queries.
 
 Anyway, if it's too complicated to implement it, perhaps it's not
 worth it. I'm just curious to see how people will use this information
 if they don't know why the temp file was created.

We have to balance functionality and ease of use.  That is the way I
analyze these issue.  We usually wait for a few people to request
additional functionality of this type, and then figure out the cleanest
way to implement it.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [pgsql-patches] [PATCHES] Patch to log usage of temporary files

2007-01-12 Thread Guillaume Smet

On 1/12/07, Bruce Momjian [EMAIL PROTECTED] wrote:

Usually people don't want th query unless they ask for it.  One nify
trick would be to print the query as DETAIL unless they are already
logging queries, but that just seems too complex.  If you want the
query, why not just log them all?


Because they can't? On a highly loaded production server, people
usually don't log all the queries.

Anyway, if it's too complicated to implement it, perhaps it's not
worth it. I'm just curious to see how people will use this information
if they don't know why the temp file was created.

--
Guillaume

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [pgsql-patches] [PATCHES] Patch to log usage of temporary files

2007-01-12 Thread Bill Moran
In response to Guillaume Smet [EMAIL PROTECTED]:

 On 1/12/07, Bruce Momjian [EMAIL PROTECTED] wrote:
  Usually people don't want th query unless they ask for it.  One nify
  trick would be to print the query as DETAIL unless they are already
  logging queries, but that just seems too complex.  If you want the
  query, why not just log them all?
 
 Because they can't? On a highly loaded production server, people
 usually don't log all the queries.
 
 Anyway, if it's too complicated to implement it, perhaps it's not
 worth it. I'm just curious to see how people will use this information
 if they don't know why the temp file was created.

I can only speak for myself but:
* I'm already using the patch in our lab.  Since the lab is the same
  hardware/config/etc as production, I can use the information to fine
  tune configs that then get migrated to production after careful testing.
  Since it's a lab environment, I'm free to turn on and off all sorts of
  stuff that would be unwise in production.  Thus the lab frequently has
  full query logging turned on.
* Currently, our production systems have plenty of spare IO.  The result
  is that I _do_ log queries on production servers, and will continue
  to do so until it becomes an issue.  Additionally, we have lots of
  room to grow with this hardware, so I can use the data collected about
  temp file usage to justify additional RAM.  Don't know how long I'll be
  able to leave query logging enabled on the production systems, but I'm
  taking advantage of it as long as possible.
* This variable can be tweaked per-session, which means if I've got queries
  that I suspect are causing unwarranted temp files on a production server,
  I can enable it on a per-connection basis to track down the problem and
  work on a specific query, on production systems, without too much
  disruption of the rest of the work that's going on:
  set log_temp_files = 0;
  run suspect query
  set log_temp_files = -1;
  investigate logs

At least, those are my current plans ...

-- 
Bill Moran
Collaborative Fusion Inc.

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org