pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How long does it take?
6+ messages / 5 participants
[nested] [flat]

* How long does it take?
@ 2002-02-13 19:14  Torbjörn Andersson <tobbe@embryo.se>
  1 sibling, 2 replies; 6+ messages in thread

From: Torbjörn Andersson @ 2002-02-13 19:14 UTC (permalink / raw)
  To: pgsql-sql

Does anyone have any good tips on how to measure the time it takes to
extecute an SQL-statement in psql?

I'd like to use it in conjunction with EXPLAIN in order to help me determine
what needs to be optimized as well as checking that my optimization actually
improved matters...

Best regards


Torbjörn Andersson
---------------------------------------------------
Embryo Communication      phone: +46 (0) 31-774 39 11(00)
Kungsgatan 7a             fax: +46 (0)31 774 07 80
S-411 19 Göteborg         mobile: 0708-30 70 04
Sweden                    home: http://www.embryo.se/
        mail: torbjorn.andersson@embryo.se
---------------------------------------------------
"Att idag tänka annorlunda än igår skiljer den vise från den envise." — John
Steinbeck




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

* Re: How long does it take?
@ 2002-02-13 19:36  clayton cottingham <drfrog@telus.net>
  parent: Torbjörn Andersson <tobbe@embryo.se>
  1 sibling, 0 replies; 6+ messages in thread

From: clayton cottingham @ 2002-02-13 19:36 UTC (permalink / raw)
  To: Torbjörn Andersson <tobbe@embryo.se>; +Cc: pgsql-sql

see explain in the docs?

http://www.postgresql.org/idocs/index.php?sql-explain.html


or you could use perls timing modules as well


ttfn


Torbjörn Andersson wrote:
> 
> Does anyone have any good tips on how to measure the time it takes to
> extecute an SQL-statement in psql?
> 
> I'd like to use it in conjunction with EXPLAIN in order to help me determine
> what needs to be optimized as well as checking that my optimization actually
> improved matters...
> 
> Best regards
> 
> Torbjörn Andersson
> ---------------------------------------------------
> Embryo Communication      phone: +46 (0) 31-774 39 11(00)
> Kungsgatan 7a             fax: +46 (0)31 774 07 80
> S-411 19 Göteborg         mobile: 0708-30 70 04
> Sweden                    home: http://www.embryo.se/
>         mail: torbjorn.andersson@embryo.se
> ---------------------------------------------------
> "Att idag tänka annorlunda än igår skiljer den vise från den envise." - John
> Steinbeck
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



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

* Re: How long does it take?
@ 2002-02-13 21:43  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Torbjörn Andersson <tobbe@embryo.se>
  1 sibling, 0 replies; 6+ messages in thread

From: Tom Lane @ 2002-02-13 21:43 UTC (permalink / raw)
  To: Torbjörn Andersson <tobbe@embryo.se>; +Cc: pgsql-sql

Torbj=?ISO-8859-1?B?9g==?=rn Andersson <tobbe@embryo.se> writes:
> Does anyone have any good tips on how to measure the time it takes to
> extecute an SQL-statement in psql?
> I'd like to use it in conjunction with EXPLAIN in order to help me determine
> what needs to be optimized as well as checking that my optimization actually
> improved matters...

See "EXPLAIN ANALYZE" in 7.2.

			regards, tom lane



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

* Re: How long does it take?
@ 2002-02-14 02:12  Frank Bax <fbax@sympatico.ca>
  1 sibling, 1 reply; 6+ messages in thread

From: Frank Bax @ 2002-02-14 02:12 UTC (permalink / raw)
  To: Torbjög ==rn Andersson <tobbe@embryo.se>; +Cc: pgsql-sql

time psql -c "select now()"
          now
------------------------
 2002-02-13 21:21:17-05
(1 row)

    0.09s real     0.05s user     0.01s system



At 08:14 PM 2/13/02 +0100, Torbjög==rn Andersson wrote:
>Does anyone have any good tips on how to measure the time it takes to
>extecute an SQL-statement in psql?
>
>I'd like to use it in conjunction with EXPLAIN in order to help me determine
>what needs to be optimized as well as checking that my optimization actually
>improved matters...
>
>Best regards
>
>
>Torbjörn Andersson
>---------------------------------------------------
>Embryo Communication      phone: +46 (0) 31-774 39 11(00)
>Kungsgatan 7a             fax: +46 (0)31 774 07 80
>S-411 19 Göteborg         mobile: 0708-30 70 04
>Sweden                    home: http://www.embryo.se/
>        mail: torbjorn.andersson@embryo.se
>---------------------------------------------------
>"Att idag tänka annorlunda än igår skiljer den vise från den envise." — John
>Steinbeck
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



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

* Re: How long does it take?
@ 2002-02-14 10:18  Torbjörn Andersson <tobbe@embryo.se>
  parent: Frank Bax <fbax@sympatico.ca>
  0 siblings, 1 reply; 6+ messages in thread

From: Torbjörn Andersson @ 2002-02-14 10:18 UTC (permalink / raw)
  To: Frank Bax <fbax@sympatico.ca>; +Cc: pgsql-sql

Den 02-02-14 03.12 skrev Frank Bax från  fbax@sympatico.ca följande:

> time psql -c "select now()"
>         now
> ------------------------
> 2002-02-13 21:21:17-05
> (1 row)
> 
>   0.09s real     0.05s user     0.01s system

Thanx!

Exactly what I needed.

Regards

Torbjörn Andersson
---------------------------------------------------
Embryo Communication      phone: +46 (0) 31-774 39 11(00)
Kungsgatan 7a             fax: +46 (0)31 774 07 80
S-411 19 Göteborg         mobile: 0708-30 70 04
Sweden                    home: http://www.embryo.se/
        mail: torbjorn.andersson@embryo.se
---------------------------------------------------
"Att idag tänka annorlunda än igår skiljer den vise från den envise." — John
Steinbeck




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

* Re: How long does it take?
@ 2002-02-14 16:43  Ross J. Reedstrom <reedstrm@rice.edu>
  parent: Torbjörn Andersson <tobbe@embryo.se>
  0 siblings, 0 replies; 6+ messages in thread

From: Ross J. Reedstrom @ 2002-02-14 16:43 UTC (permalink / raw)
  To: Torbj?rn Andersson <tobbe@embryo.se>; +Cc: Frank Bax <fbax@sympatico.ca>; pgsql-sql

Do realize that you're timing the psql frontend with this, not the 
postgresql backend: the only number from that with any meaning is 
the 'real' wallclock time, and that will be affected by other loads
on either system, or the network between them.

Ross


On Thu, Feb 14, 2002 at 11:18:06AM +0100, Torbj?rn Andersson wrote:
> Den 02-02-14 03.12 skrev Frank Bax fr?n  fbax@sympatico.ca f?ljande:
> 
> > time psql -c "select now()"
> >         now
> > ------------------------
> > 2002-02-13 21:21:17-05
> > (1 row)
> > 
> >   0.09s real     0.05s user     0.01s system
> 
> Thanx!
> 
> Exactly what I needed.
> 
> Regards
> 
> Torbj?rn Andersson
> ---------------------------------------------------
> Embryo Communication      phone: +46 (0) 31-774 39 11(00)
> Kungsgatan 7a             fax: +46 (0)31 774 07 80
> S-411 19 G?teborg         mobile: 0708-30 70 04
> Sweden                    home: http://www.embryo.se/
>         mail: torbjorn.andersson@embryo.se
> ---------------------------------------------------
> "Att idag t?nka annorlunda ?n ig?r skiljer den vise fr?n den envise." ? John
> Steinbeck
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster



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


end of thread, other threads:[~2002-02-14 16:43 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-13 19:14 ` Torbjörn Andersson <tobbe@embryo.se>
2002-02-13 19:36   ` clayton cottingham <drfrog@telus.net>
2002-02-13 21:43   ` Tom Lane <tgl@sss.pgh.pa.us>
2002-02-14 02:12 ` Frank Bax <fbax@sympatico.ca>
2002-02-14 10:18   ` Torbjörn Andersson <tobbe@embryo.se>
2002-02-14 16:43     ` Ross J. Reedstrom <reedstrm@rice.edu>

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