Tom Lane wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > There is a TODO item:
> >     * Allow logging of query durations
> 
> > Currently there is no easy way to get a list of query durations in the
> > server log file.  My idea is to add query duration to the end of the
> > query string for 'debug_print_query'.  My only problem is that to print
> > the duration, I would have to print the query _after_ it is executed,
> > rather than before.
> 
> Well, that's what makes it a bad idea, eh?
> 
> I think the log entries should be separate: print the query text when
> you start, print the duration when you're done.  A little bit of
> postprocessing can reassemble the two entries.

How would someone reassemble them?  You would have to have the pid, I
assume.  Do we auto-enable pid output when we enable duration?  Yuck.
Maybe print the pid just for the query and timing lines if pid print
isn't enabled?

I would think printing it out together at the end would work.  We
already have several ways to see running queries.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to