Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 37BB31337B8D for ; Fri, 4 Feb 2011 10:49:59 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 55586-06 for ; Fri, 4 Feb 2011 14:49:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from depesz.com (martin.depesz.com [188.40.39.14]) by mail.postgresql.org (Postfix) with ESMTP id DE5E5133740B for ; Fri, 4 Feb 2011 10:49:51 -0400 (AST) Received: from martin.depesz.com ([188.40.39.14] helo=depesz.com) by depesz.com with esmtpa (Exim 4.69) (envelope-from ) id 1PlMyt-0001K0-K8; Fri, 04 Feb 2011 15:49:51 +0100 Date: Fri, 4 Feb 2011 15:49:51 +0100 From: hubert depesz lubaczewski To: felix Cc: pgsql-performance@postgresql.org Subject: Re: Really really slow select count(*) Message-ID: <20110204144950.GA4543@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/188 X-Sequence-Number: 42326 On Fri, Feb 04, 2011 at 03:46:35PM +0100, felix wrote: > directly after REINDEX and ANALYZE: > > Aggregate (cost=62348.70..62348.71 rows=1 width=0) (actual > time=15830.000..15830.000 rows=1 loops=1) > -> Seq Scan on fastadder_fastadderstatus (cost=0.00..61613.16 > rows=294216 width=0) (actual time=30.000..15570.000 rows=302479 loops=1) > Total runtime: 15830.000 ms do run vacuum of the table. reindex doesn't matter for seq scans, and analyze, while can help choose different plan - will not help here anyway. Best regards, depesz