From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Kynn Jones <kynnjo@gmail.com>
Cc: Andreas Kretschmer <akretschmer@spamfence.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: How to profile an "SQL script"?
Date: Wed, 03 Dec 2008 22:46:54 +0200
Message-ID: <4936F03E.5040205@enterprisedb.com> (raw)
In-Reply-To: <20081203194023.GA8541@tux>
References: <c2350ba40812031131r1acd66a9idd2869a4899b1798@mail.gmail.com>
<20081203194023.GA8541@tux>
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
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: heikki.linnakangas@enterprisedb.com, kynnjo@gmail.com, akretschmer@spamfence.net
Subject: Re: How to profile an "SQL script"?
In-Reply-To: <4936F03E.5040205@enterprisedb.com>
* 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