Forum OpenACS Q&A: Filter to measure duration of Postgres-Query

Does anyone have experience with filters that measure the duration of
every single Postgres-Query? Where can I get it from and how do I
install and use it?
Collapse
Posted by David Kuczek on
I asked a German Postgres Developer and he answered:

"nicht direkt, aber man kann in perl vor und nach dem query einen timestamp ausgeben." 😉

which means

"not directly, but you can display a timestamp in perl before and after a query."

As I am quite new to acs and tcl... does anyone have an example how to do it in tcl?

It would be helpful for some query tuning I believe!?

On Oracle there's set timing on and Developer Services. To do something like the Perl solution you suggest, it'd be:

set starttime [ns_time]
# execute query
set endtime [ns_time]
set elapsedtime [expr $endtime - $starttime]

Collapse
Posted by David Kuczek on
Easy is good... Thanks