Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 3D12A1337B5A for ; Mon, 18 Oct 2010 08:41:49 -0300 (ADT) 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 18555-08 for ; Mon, 18 Oct 2010 11:41:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hrndva-omtalb.mail.rr.com (hrndva-omtalb.mail.rr.com [71.74.56.123]) by mail.postgresql.org (Postfix) with ESMTP id 0CAD11337B5E for ; Mon, 18 Oct 2010 08:41:41 -0300 (ADT) X-Authority-Analysis: v=1.1 cv=iGF3DqghDyT/uy4mV2LvOKNXCATMSjL+tOl9cucoGVk= c=1 sm=0 a=8WdnqGfmmC0A:10 a=IkcTkHD0fZMA:10 a=RAii6je2cdnAH6ATCOpc6g==:17 a=_Ixf_7qHAAAA:8 a=g3QAGawRA5Fwt9bS6h8A:9 a=NYxtqcZiEELpPmXbOIgA:7 a=MiefUvOYis84bxcbt4Z2alBV8MgA:4 a=QEXdDO2ut3YA:10 a=ryAo9hy1-OkA:10 a=6vsjEBoLwlAA:10 a=0tfO7MgyNwYA:10 a=RAii6je2cdnAH6ATCOpc6g==:117 X-Cloudmark-Score: 0 X-Originating-IP: 74.73.87.196 Received: from [74.73.87.196] ([74.73.87.196:53061] helo=[192.168.1.103]) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id F9/4A-27923-5723CBC4; Mon, 18 Oct 2010 11:41:41 +0000 Message-ID: <4CBC3275.9020000@vmsinfo.com> Date: Mon, 18 Oct 2010 07:41:41 -0400 From: Mladen Gogala User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Select count(*), the sequel References: <4CB9D82F.9040505@gmail.com> <4CBBFE2F.3010801@gmail.com> In-Reply-To: <4CBBFE2F.3010801@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/287 X-Sequence-Number: 40705 On 10/18/2010 3:58 AM, Vitalii Tymchyshyn wrote: > Hello. > > Did you vacuum postgresql DB before the count(*). I ask this because > (unless table was created& loaded in same transaction) on the first > scan, postgresql has to write hint bits to the whole table. Second scan > may be way faster. > > Best regards, Vitalii Tymchyshyn Vitalli, yes I did vacuum before the count. -- Mladen Gogala Sr. Oracle DBA 1500 Broadway New York, NY 10036 (212) 329-5251 www.vmsinfo.com