Re: Reporting query duration

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reporting query duration
Date: 2002-08-30 03:51:35
Message-ID: 26178.1030679495@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> 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.

> Should we rename it and support both log_print_query and
> debug_print_query for one release?

If we're gonna rename config variables, let's just rename them.
People don't try to pipe their old postgresql.conf files into psql,
so I don't think there's a really good argument for supporting old
variable names for a long time.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2002-08-30 03:53:02 Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U
Previous Message Bruce Momjian 2002-08-30 03:47:36 Remove wal_files