pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: How to time several queries?
4+ messages / 3 participants
[nested] [flat]

* How to time several queries?
@ 2004-10-18 18:28 nd02tsk@student.hig.se
  2004-10-18 18:11 ` Re: How to time several queries? Joshua D. Drake <jd@commandprompt.com>
  2004-10-20 12:50 ` Re: How to time several queries? Matthew Nuzum <newz@bearfruit.org>
  0 siblings, 2 replies; 4+ messages in thread

From: nd02tsk@student.hig.se @ 2004-10-18 18:28 UTC (permalink / raw)
  To: pgsql-performance

Hello

I posted this on the general list but think it would be more appropriate
here. Sorry.

I know it is possible to time isolated queries through the settting of the
\timing option in psql. This makes PgSQL report the time it took to
perform one operation.

I would like to know how one can get a time summary of many operations, if
it is at all possible.

Thank you.

Tim





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

* Re: How to time several queries?
  2004-10-18 18:28 How to time several queries? nd02tsk@student.hig.se
@ 2004-10-18 18:11 ` Joshua D. Drake <jd@commandprompt.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Joshua D. Drake @ 2004-10-18 18:11 UTC (permalink / raw)
  To: nd02tsk@student.hig.se; +Cc: pgsql-performance

nd02tsk@student.hig.se wrote:

>Hello
>
>I posted this on the general list but think it would be more appropriate
>here. Sorry.
>
>I know it is possible to time isolated queries through the settting of the
>\timing option in psql. This makes PgSQL report the time it took to
>perform one operation.
>
>I would like to know how one can get a time summary of many operations, if
>it is at all possible.
>
>  
>
Hello,

You can turn on statement and duration logging in the postgresql.conf


>Thank you.
>
>Tim
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>  
>


-- 
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL




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

* Re: How to time several queries?
  2004-10-18 18:28 How to time several queries? nd02tsk@student.hig.se
@ 2004-10-20 12:50 ` Matthew Nuzum <newz@bearfruit.org>
  1 sibling, 0 replies; 4+ messages in thread

From: Matthew Nuzum @ 2004-10-20 12:50 UTC (permalink / raw)
  To: nd02tsk@student.hig.se; pgsql-performance

When I'm using psql and I want to time queries, which is what I've been
doing for a little over a day now, I do the following:

Select now(); query 1; query 2; query 3; select now();

This works fine unless you're doing selects with a lot of rows which will
cause your first timestamp to scroll off the screen.

-- 
Matthew Nuzum      + "Man was born free, and everywhere
www.bearfruit.org  :  he is in chains," Rousseau
+~~~~~~~~~~~~~~~~~~+ "Then you will know the truth, and 
the TRUTH will set you free," Jesus Christ (John 8:32 NIV)

-----Original Message-----
From: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of
nd02tsk@student.hig.se
Sent: Monday, October 18, 2004 2:28 PM
To: pgsql-performance@postgresql.org
Subject: [PERFORM] How to time several queries?

Hello

I posted this on the general list but think it would be more appropriate
here. Sorry.

I know it is possible to time isolated queries through the settting of the
\timing option in psql. This makes PgSQL report the time it took to
perform one operation.

I would like to know how one can get a time summary of many operations, if
it is at all possible.

Thank you.

Tim



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster




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

* Re: How to time several queries?
@ 2004-10-20 11:50 nd02tsk@student.hig.se
  0 siblings, 0 replies; 4+ messages in thread

From: nd02tsk@student.hig.se @ 2004-10-20 11:50 UTC (permalink / raw)
  To: pgsql-performance

It doesn't seem to work. I want a time summary at the end. I am inserting
insert queries from a file with the \i option.

This is the outcome:

[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.672 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.730 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.698 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.805 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.670 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.831 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.815 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.793 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.660 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.667 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.754 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.668 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.688 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.671 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.787 ms
[7259] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27');
[7259] LOG:  duration: 1.722 ms
[7309] LOG:  statement: DELETE FROM weather;
[7309] LOG:  duration: 11.314 ms
[7330] LOG:  statement: INSERT INTO weather VALUES ('San Francisco', 46,
50, 0.25, '1994-11-27')


Tim





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


end of thread, other threads:[~2004-10-20 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-18 18:28 How to time several queries? nd02tsk@student.hig.se
2004-10-18 18:11 ` Joshua D. Drake <jd@commandprompt.com>
2004-10-20 12:50 ` Matthew Nuzum <newz@bearfruit.org>
2004-10-20 11:50 Re: How to time several queries? nd02tsk@student.hig.se

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