Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5E1801336FA7 for ; Fri, 4 Feb 2011 14:38:17 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 61700-04 for ; Fri, 4 Feb 2011 18:38:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mail.postgresql.org (Postfix) with ESMTP id D8BD11336B42 for ; Fri, 4 Feb 2011 14:38:09 -0400 (AST) Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0LaJMk-1QQqdk2Pcc-00lRQL; Fri, 04 Feb 2011 19:38:07 +0100 Message-ID: <4D4C478D.9070909@2ndquadrant.com> Date: Fri, 04 Feb 2011 13:38:05 -0500 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: felix CC: sthomas@peak6.com, pgsql-performance@postgresql.org Subject: Re: Really really slow select count(*) References: <4D4C138C.7010304@2ndquadrant.com> <4D4C1555.40209@peak6.com> <4D4C2AC3.5020804@peak6.com> <4D4C3BCA.5010808@peak6.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:L2lpSXExpLADLZuPk2+QjnQ1XgL/S2oEsE/KEDBLMSY wk3iV8BYKWwC7aq4lgizmurATyVHZMTTET1ttqR6/uYn3cv9RX ohBdYh7SqWCKplM7kgXAkUAaEf6yricdgrckJ5PNjr/RMfNVmv U3XmokCSmzqCc/maECFXGCGMe+xuF/MXHatX+qg52Fo7DW0RzB /ZlYDsam7p3y81tcF9LraUwz0j5YchTzTFKLHisrCM= 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: 201102/208 X-Sequence-Number: 42346 felix wrote: > and do you agree that I should turn CLUSTER ON ? > I have no problem to stop all tasks to this table at night and just > reload it You don't turn it on; it's a one time operation that does a cleanup. It is by far the easiest way to clean up the mess you have right now. Moving forward, if you have max_fsm_pages set to an appropriate number, you shouldn't end up back in this position again. But VACUUM along won't get you out of there, and VACUUM FULL is always a worse way to clean this up than CLUSTER. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books