pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Measuring statement runtime?
2+ messages / 2 participants
[nested] [flat]

* Measuring statement runtime?
@ 2007-02-07 17:00  Andrew Edson <cheighlund@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Andrew Edson @ 2007-02-07 17:00 UTC (permalink / raw)
  To: pgsql-admin

I've got a particular sql statement I'm trying to work out that seems to be taking far too long to run.  I've been told that there's supposed to be some kind of timing command to record how long a statement runs for, but I'm having trouble figuring it out.  The textbook I'm working with, PostgreSQL (Second Edition) seems to be indicating a command called 'timer' but that has, so far, always thrown an error on the 't'.  A search for both 'timer' and 'timing' on Postgresql.org brings up a number of results, but they all appear to have something to do with 'time' and timestamps rather than what I am attempting to find out.
   
  What is the command I should be looking for to measure the runtime on my statements?

 
---------------------------------
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

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

* Re: Measuring statement runtime?
@ 2007-02-07 18:41  Andrew Sullivan <ajs@crankycanuck.ca>
  parent: Andrew Edson <cheighlund@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Andrew Sullivan @ 2007-02-07 18:41 UTC (permalink / raw)
  To: pgsql-admin

On Wed, Feb 07, 2007 at 09:00:32AM -0800, Andrew Edson wrote:
>   What is the command I should be looking for to measure the
>   runtime on my statements?

In psql, use \timing.

In your postgresql.conf file, you can set
log_min_duration_statement=0.  

You can also use EXPLAIN ANALYSE to see the full execution plan, plus
information about how long each step _actually_ takes.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Users never remark, "Wow, this software may be buggy and hard 
to use, but at least there is a lot of code underneath."
		--Damien Katz



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


end of thread, other threads:[~2007-02-07 18:41 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-02-07 17:00 Measuring statement runtime? Andrew Edson <cheighlund@yahoo.com>
2007-02-07 18:41 ` Andrew Sullivan <ajs@crankycanuck.ca>

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