From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-performance@postgresql.org
Subject: Re: How to profile an "SQL script"?
Date: Wed, 3 Dec 2008 20:40:23 +0100
Message-ID: <20081203194023.GA8541@tux> (raw)
In-Reply-To: <c2350ba40812031131r1acd66a9idd2869a4899b1798@mail.gmail.com>
References: <c2350ba40812031131r1acd66a9idd2869a4899b1798@mail.gmail.com>
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°
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: akretschmer@spamfence.net
Subject: Re: How to profile an "SQL script"?
In-Reply-To: <20081203194023.GA8541@tux>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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