X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 55D7D54240 for ; Sat, 23 Apr 2005 15:28:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56821-07 for ; Sat, 23 Apr 2005 18:28:17 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id 3E9CB5423F for ; Sat, 23 Apr 2005 15:28:14 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 7275079; Sat, 23 Apr 2005 11:30:13 -0700 From: Josh Berkus Organization: Aglio Database Solutions To: Kevin Brown Subject: Re: Joel's Performance Issues WAS : Opteron vs Xeon Date: Sat, 23 Apr 2005 11:27:42 -0700 User-Agent: KMail/1.6.2 Cc: 'Postgresql Performance' References: <4266F7B3.7050004@arbash-meinel.com> <20050423020151.GW58835@decibel.org> <20050423063044.GI19518@filer> In-Reply-To: <20050423063044.GI19518@filer> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200504231127.42389.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/651 X-Sequence-Number: 12048 Jim, Kevin, > > Hrm... I was about to suggest that for timing just the query (and not > > output/data transfer time) using explain analyze, but then I remembered > > that explain analyze can incur some non-trivial overhead with the timing > > calls. Is there a way to run the query but have psql ignore the output? > > If so, you could use \timing. > > Would timing "SELECT COUNT(*) FROM (query)" work? Just \timing would work fine; PostgreSQL doesn't return anything until it has the whole result set. That's why MSSQL vs. PostgreSQL timing comparisons are deceptive unless you're careful: MSSQL returns the results on block at a time, and reports execution time as the time required to return the *first* block, as opposed to Postgres which reports the time required to return the whole dataset. -- Josh Berkus Aglio Database Solutions San Francisco