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 A6DDC8B9EBA for ; Thu, 10 Feb 2005 18:34:49 +0000 (GMT) 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 88036-03 for ; Thu, 10 Feb 2005 18:34:42 +0000 (GMT) Received: from greywolf.vistashare.net (www.vistashare.net [65.207.67.162]) by svr1.postgresql.org (Postfix) with ESMTP id C0FFE8B9E31 for ; Thu, 10 Feb 2005 18:34:41 +0000 (GMT) Received: from [10.100.2.210] (phoenix.vistashare.net [10.100.2.210]) by greywolf.vistashare.net (Postfix) with ESMTP id AC32F141A9B for ; Thu, 10 Feb 2005 13:34:40 -0500 (EST) From: Chris Kratz Organization: VistaShare To: pgsql-performance@postgresql.org Subject: Large time difference between explain analyze and normal run Date: Thu, 10 Feb 2005 13:34:40 -0500 User-Agent: KMail/1.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502101334.40341.chris.kratz@vistashare.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/172 X-Sequence-Number: 10501 Does anyone have any idea why there be over a 4s difference between running the statement directly and using explain analyze? Multiple runs give the same result and I've tested on several servers. db=# \timing Timing is on. db=# select count(*) from answer; count -------- 530576 (1 row) Time: 358.805 ms db=# explain analyze select count(*) from answer; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- Aggregate (cost=9848.12..9848.12 rows=1 width=0) (actual time=4841.231..4841.235 rows=1 loops=1) -> Seq Scan on answer (cost=0.00..8561.29 rows=514729 width=0) (actual time=0.011..2347.762 rows=530576 loops=1) Total runtime: 4841.412 ms (3 rows) Time: 4855.712 ms --- Postgresql 7.4.5 running on Linux 2.6.8.1