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 A15478B9E31 for ; Thu, 10 Feb 2005 18:58:48 +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 90030-04 for ; Thu, 10 Feb 2005 18:58:40 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E2A258B9D56 for ; Thu, 10 Feb 2005 18:58:38 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1AIwb1M028554; Thu, 10 Feb 2005 13:58:37 -0500 (EST) To: Chris Kratz Cc: pgsql-performance@postgresql.org Subject: Re: Large time difference between explain analyze and normal run In-reply-to: <200502101334.40341.chris.kratz@vistashare.com> References: <200502101334.40341.chris.kratz@vistashare.com> Comments: In-reply-to Chris Kratz message dated "Thu, 10 Feb 2005 13:34:40 -0500" Date: Thu, 10 Feb 2005 13:58:37 -0500 Message-ID: <28553.1108061917@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/173 X-Sequence-Number: 10502 Chris Kratz writes: > Does anyone have any idea why there be over a 4s difference between running > the statement directly and using explain analyze? > 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 EXPLAIN ANALYZE's principal overhead is two gettimeofday() kernel calls per plan node execution, so 1061154 such calls here. I infer that gettimeofday takes about 4 microseconds on your hardware ... which seems a bit slow for modern machines. What sort of box is it? regards, tom lane