Re: Reporting query duration - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Reporting query duration
Date
Msg-id 26178.1030679495@sss.pgh.pa.us
Whole thread Raw
In response to Reporting query duration  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Reporting query duration  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Remove wal_files
Next
From: Alvaro Herrera
Date:
Subject: Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U