Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2634163341E for ; Thu, 14 Jan 2010 12:01:19 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 28343-05 for ; Thu, 14 Jan 2010 16:01:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id A6B706330E3 for ; Thu, 14 Jan 2010 12:01:08 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NVS7n-0006Rb-HV for pgsql-performance@postgresql.org; Thu, 14 Jan 2010 17:00:43 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Jan 2010 17:00:43 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Jan 2010 17:00:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Ivan Voras Subject: Re: Slow "Select count(*) ..." query on table with 60 Mio. rows Date: Thu, 14 Jan 2010 16:59:57 +0100 Lines: 11 Message-ID: References: <4B4EE849020000250002E4A4@gw.wicourts.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.23 (X11/20091210) In-Reply-To: <4B4EE849020000250002E4A4@gw.wicourts.gov> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.448 tagged_above=-10 required=5 tests=BAYES_20=-0.74, FH_DATE_PAST_20XX=3.188 X-Spam-Level: ** X-Archive-Number: 201001/283 X-Sequence-Number: 37163 Kevin Grittner wrote: > Matthew Wakeling wrote: > >> This is an FAQ. > > I just added it to the wiki FAQ page: > > http://wiki.postgresql.org/wiki/FAQ#Why_is_.22SELECT_count.28.2A.29_FROM_bigtable.3B.22_slow.3F Maybe you could add a short note why an estimation like from the pg_class table is usually enough.