Skip site navigation (1) Skip section navigation (2)

Re: How to profile an "SQL script"?

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Kynn Jones <kynnjo(at)gmail(dot)com>
Cc: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: How to profile an "SQL script"?
Date: 2008-12-03 20:46:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Andreas Kretschmer wrote:
> Kynn Jones <kynnjo(at)gmail(dot)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

In response to

pgsql-performance by date

Next:From: Kynn JonesDate: 2008-12-04 00:03:00
Subject: Re: How to profile an "SQL script"?
Previous:From: Andreas KretschmerDate: 2008-12-03 19:40:23
Subject: Re: How to profile an "SQL script"?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group