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 CBCFA32A080 for ; Tue, 5 Oct 2004 07:49:36 +0100 (BST) 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 93944-02 for ; Tue, 5 Oct 2004 06:49:30 +0000 (GMT) Received: from vertigo.530collins.mel.nella.net.au (vertigo.530collins.mel.nella.net.au [202.76.191.244]) by svr1.postgresql.org (Postfix) with ESMTP id A014632A482 for ; Tue, 5 Oct 2004 07:49:27 +0100 (BST) Received: from capricorn ([202.61.206.7]) by vertigo.530collins.mel.nella.net.au (8.12.8/8.12.8) with SMTP id i956rN3r017717 for ; Tue, 5 Oct 2004 16:53:26 +1000 From: "Chris Hutchinson" To: Subject: EXPLAIN ANALYZE much slower than running query normally Date: Tue, 5 Oct 2004 16:49:26 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X--MailScanner-Information: Please contact the ISP for more information X--MailScanner: Found to be clean X--MailScanner-SpamScore: sss X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/130 X-Sequence-Number: 8606 Running a trivial query in v7.4.2 (installed with fedora core2) using EXPLAIN ANALYZE is taking considerably longer than just running the query (2mins vs 6 secs). I was using this query to quickly compare a couple of systems after installing a faster disk. Is this sort of slowdown to be expected? Here's the query: ---------------------------------------- [chris@fedora tmp]$ time psql dbt << ENDSQL > select count(*) from etab; > ENDSQL count --------- 9646782 (1 row) real 0m6.532s user 0m0.005s sys 0m0.002s [chris@fedora tmp]$ time psql dbt << ENDSQL > explain analyze select count(*) from etab; > ENDSQL QUERY PLAN ---------------------------------------------------------------------------- --------------- ----------------------------- Aggregate (cost=182029.78..182029.78 rows=1 width=0) (actual time=112701.488..112701.493 rows=1 loops=1) -> Seq Scan on etab (cost=0.00..157912.82 rows=9646782 width=0) (actual time=0.053..578 59.120 rows=9646782 loops=1) Total runtime: 112701.862 ms (3 rows) real 1m52.716s user 0m0.003s sys 0m0.005s --------------------------------------- Thanks in advance for any clues. Chris Hutchinson