Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1D95D9FA06B for ; Wed, 11 Jul 2007 13:11:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 94364-02 for ; Wed, 11 Jul 2007 13:11:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [62.232.55.118]) by postgresql.org (Postfix) with ESMTP id 59DBC9FA4D4 for ; Wed, 11 Jul 2007 13:11:13 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1I8emT-00015w-SF; Wed, 11 Jul 2007 17:11:09 +0100 From: Gregory Stark To: "Andrew Sullivan" Cc: Subject: Re: TIMING A QUERY ??? In-Reply-To: <20070711153911.GQ1241@phlogiston.dyndns.org> (Andrew Sullivan's message of "Wed, 11 Jul 2007 11:39:11 -0400") Organization: EnterpriseDB References: <11542393.post@talk.nabble.com> <20070711153911.GQ1241@phlogiston.dyndns.org> X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 1477) Date: Wed, 11 Jul 2007 17:11:09 +0100 Message-ID: <87bqeiapk2.fsf@oxford.xeocode.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/99 X-Sequence-Number: 25783 "Andrew Sullivan" 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