From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: TIMING A QUERY ???
Date: Wed, 11 Jul 2007 12:10:55 -0400
Message-ID: <26707.1184170255@sss.pgh.pa.us> (raw)
In-Reply-To: <20070711153911.GQ1241@phlogiston.dyndns.org>
References: <11542393.post@talk.nabble.com>
<20070711153911.GQ1241@phlogiston.dyndns.org>
Andrew Sullivan <ajs@crankycanuck.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?
Well, on some platforms (ie consumer-grade PCs) explain analyze can be a
lot slower than just running the query, because of the overhead of all
those gettimeofday() calls it does. El cheapo clock hardware is slow
to read. (I think the problem is actually that the PC-standard hardware
API for clocks was designed back when taking a whole microsecond to read
the clock didn't seem like a problem.)
>> ...can I use \timing??? I don't get any time when using the
>> \timing option...
> How so? It returns Time: N ms at the end of output for me.
Works for me too.
regards, tom lane
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: tgl@sss.pgh.pa.us, ajs@crankycanuck.ca
Subject: Re: TIMING A QUERY ???
In-Reply-To: <26707.1184170255@sss.pgh.pa.us>
* 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