Re: How can I make note of time taken by each query to execute in Triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "shreedhar" <shreedhar(at)lucidindia(dot)net>
Cc: "Postgres" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How can I make note of time taken by each query to execute in Triggers
Date: 2003-01-23 05:19:15
Message-ID: 23340.1043299155@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"shreedhar" <shreedhar(at)lucidindia(dot)net> writes:
> I would like read time taken by each query in my triggers.
> so i created a temporary table and inserted timestamp before i start qurey
> and inserted again timestamp after completion of the query. But i am getting
> same time. How can I get the time taken by each query.

timeofday(). See
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Yudha Setiawan 2003-01-23 10:08:08 OOT: history of my command
Previous Message Andrew Biagioni 2003-01-23 04:50:48 Re: How can I make note of time taken by each query to execute in Triggers