Re: getting elapsed query times

From: bricklen <bricklen(at)gmail(dot)com>
To: "Aaron Burnett" <aburnett(at)bzzagent(dot)com>
Cc: "Craig Ringer" <craig(at)postnewspapers(dot)com(dot)au>, pgsql-general(at)postgresql(dot)org
Subject: Re: getting elapsed query times
Date: 2009-01-06 20:45:54
Message-ID: 33b743250901061245h7a3f0dg3bc745062e5ea14f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 4, 2009 at 7:01 PM, Craig Ringer
<craig(at)postnewspapers(dot)com(dot)au> wrote:
> Alternately, rather than doing everything within PL/PgSQL, just do it from
> normal SQL, issued through psql. That way you can just use \timing .
>
> For simple one-liners, instead of:
>
> psql -d DB1 -c 'select execute_function_foo();'
>
> you can write:
>
> psql -d DB1 <<__END__
> \timing
> select execute_function_foo();
> __END__

Or just add \timing to your .psqlrc file for simplicity
eg.
$ cat ~postgres/.psqlrc
\timing

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Richardson 2009-01-06 21:00:51 Generic provider for .Net
Previous Message Dan Armbrust 2009-01-06 20:39:21 Re: Slow Vacuum was: vacuum output question