Re: TIMING A QUERY ???

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Andrew Sullivan" <ajs(at)crankycanuck(dot)ca>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: TIMING A QUERY ???
Date: 2007-07-11 16:11:09
Message-ID: 87bqeiapk2.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Andrew Sullivan" <ajs(at)crankycanuck(dot)ca> writes:

> On Wed, Jul 11, 2007 at 08:21:40AM -0700, smiley2211 wrote:
>>
>> How can I get the time it takes a query to execute - explain analyze is
>> taking over 5 hours to complete
>
> You can't get it any faster than what explain analyse does: it runs
> the query. How else would you get the answer?

explain analyze does actually run slower than the actual query because it has
to check the time before and after each step of the query, potentially
thousands of times. If it's a disk-bound query that doesn't matter much but if
it's a cpu-bound query it can.

>> ...can I use \timing??? I don't get any time when using the
>> \timing option...

Yes you can use \timing. You'll have to provide more information of what
you're doing before anyone can help you.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jignesh K. Shah 2007-07-11 16:33:01 Re: PostgreSQL publishes first real benchmark
Previous Message Tom Lane 2007-07-11 16:10:55 Re: TIMING A QUERY ???