pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to profile an "SQL script"?
4+ messages / 3 participants
[nested] [flat]
* How to profile an "SQL script"?
@ 2008-12-03 19:31 Kynn Jones <kynnjo@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Kynn Jones @ 2008-12-03 19:31 UTC (permalink / raw)
To: pgsql-performance
Hi. I have a longish collection of SQL statements stored in a file that I
run periodically via cron. Running this "script" takes a bit too long, even
for a cron job, and I would like to streamline it.
Is there a way to tell Postgres to print out, after each SQL statement is
executed, how long it took to execute?
Thanks!
Kynn
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to profile an "SQL script"?
@ 2008-12-03 19:40 Andreas Kretschmer <akretschmer@spamfence.net>
parent: Kynn Jones <kynnjo@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Kretschmer @ 2008-12-03 19:40 UTC (permalink / raw)
To: pgsql-performance
Kynn Jones <kynnjo@gmail.com> schrieb:
> Hi. I have a longish collection of SQL statements stored in a file that I run
> periodically via cron. Running this "script" takes a bit too long, even for a
> cron job, and I would like to streamline it.
>
> Is there a way to tell Postgres to print out, after each SQL statement is
> executed, how long it took to execute?
Do you run this with psql? You can switch on timing-output, with
\timing. It displays after each statement the run-time for this
statement.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to profile an "SQL script"?
@ 2008-12-03 20:46 Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
parent: Andreas Kretschmer <akretschmer@spamfence.net>
1 sibling, 0 replies; 4+ messages in thread
From: Heikki Linnakangas @ 2008-12-03 20:46 UTC (permalink / raw)
To: Kynn Jones <kynnjo@gmail.com>; +Cc: Andreas Kretschmer <akretschmer@spamfence.net>; pgsql-performance
Andreas Kretschmer wrote:
> Kynn Jones <kynnjo@gmail.com> schrieb:
>
>> Hi. I have a longish collection of SQL statements stored in a file that I run
>> periodically via cron. Running this "script" takes a bit too long, even for a
>> cron job, and I would like to streamline it.
>>
>> Is there a way to tell Postgres to print out, after each SQL statement is
>> executed, how long it took to execute?
>
> Do you run this with psql? You can switch on timing-output, with
> \timing. It displays after each statement the run-time for this
> statement.
See also log_duration and log_min_duration settings.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to profile an "SQL script"?
@ 2008-12-04 00:03 Kynn Jones <kynnjo@gmail.com>
parent: Andreas Kretschmer <akretschmer@spamfence.net>
1 sibling, 0 replies; 4+ messages in thread
From: Kynn Jones @ 2008-12-04 00:03 UTC (permalink / raw)
To: Andreas Kretschmer <akretschmer@spamfence.net>; +Cc: pgsql-performance
Andreas, Heikki:
Thanks!
Kynn
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2008-12-04 00:03 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-12-03 19:31 How to profile an "SQL script"? Kynn Jones <kynnjo@gmail.com>
2008-12-03 19:40 ` Andreas Kretschmer <akretschmer@spamfence.net>
2008-12-03 20:46 ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
2008-12-04 00:03 ` Kynn Jones <kynnjo@gmail.com>
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