pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How can I make note of time taken by each query to execute in Triggers
3+ messages / 3 participants
[nested] [flat]

* How can I make note of time taken by each query to execute in Triggers
@ 2003-01-23 04:20 shreedhar <shreedhar@lucidindia.net>
  2003-01-23 04:50 ` Re: How can I make note of time taken by each query to execute in Triggers Andrew Biagioni <andrew.biagioni@e-greek.net>
  2003-01-23 05:19 ` Re: How can I make note of time taken by each query to execute in Triggers Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: shreedhar @ 2003-01-23 04:20 UTC (permalink / raw)
  To: pgsql-admin

Hi All,
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.

Regards,
Sreedhar
"Faith, faith, faith in ourselves, faith, faith in God, this is the secret
of greatness.
If you have faith in all the three hundred and thirty millions of your
mythological gods,
and in all the gods which foreigners have now and again introduced into your
midst,
and still have no faith in yourselves, there is no salvation for you. "
(III. 190)




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How can I make note of time taken by each query to execute in Triggers
  2003-01-23 04:20 How can I make note of time taken by each query to execute in Triggers shreedhar <shreedhar@lucidindia.net>
@ 2003-01-23 04:50 ` Andrew Biagioni <andrew.biagioni@e-greek.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Andrew Biagioni @ 2003-01-23 04:50 UTC (permalink / raw)
  To: pgsql-admin; shreedhar <shreedhar@lucidindia.net>

One of the options you can specify in postgresql.conf, is to write to log the 
amount of time of each query.  That should give you the precision you need, 
although of course you need to look at a log file and not at a DB table...

If you try this approach, I recommend you specify printing out the queries as 
well, that will allow you to distinguish what is taking how long.

		Andrew


1/22/03 11:20:15 PM, "shreedhar" <shreedhar@lucidindia.net> wrote:

>Hi All,
>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.
>
>Regards,
>Sreedhar
>"Faith, faith, faith in ourselves, faith, faith in God, this is the secret
>of greatness.
>If you have faith in all the three hundred and thirty millions of your
>mythological gods,
>and in all the gods which foreigners have now and again introduced into your
>midst,
>and still have no faith in yourselves, there is no salvation for you. "
>(III. 190)
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo@postgresql.org so that your
>message can get through to the mailing list cleanly
>
>






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How can I make note of time taken by each query to execute in Triggers
  2003-01-23 04:20 How can I make note of time taken by each query to execute in Triggers shreedhar <shreedhar@lucidindia.net>
@ 2003-01-23 05:19 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2003-01-23 05:19 UTC (permalink / raw)
  To: shreedhar <shreedhar@lucidindia.net>; +Cc: pgsql-admin

"shreedhar" <shreedhar@lucidindia.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-DATETI...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-01-23 05:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-23 04:20 How can I make note of time taken by each query to execute in Triggers shreedhar <shreedhar@lucidindia.net>
2003-01-23 04:50 ` Andrew Biagioni <andrew.biagioni@e-greek.net>
2003-01-23 05:19 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox