Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 4D01A9F9AE6 for ; Mon, 13 Aug 2007 11:07:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 40639-08 for ; Mon, 13 Aug 2007 11:07:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id CB4D59F96F5 for ; Mon, 13 Aug 2007 11:07:14 -0300 (ADT) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Mon, 13 Aug 2007 09:07:12 -0500 Message-Id: <46C01F36.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Mon, 13 Aug 2007 09:07:03 -0500 From: "Kevin Grittner" To: "valgog" ,, Subject: Re: select count(*) performance References: <1186578085.034463.116030@q75g2000hsh.googlegroups.com> <5i64cvF3mnmcsU1@mid.individual.net> <1187005089.011403.303320@w3g2000hsg.googlegroups.com> In-Reply-To: <1187005089.011403.303320@w3g2000hsg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/126 X-Sequence-Number: 26256 >>> valgog 08/13/07 6:38 AM >>>=20 On Aug 11, 5:54 pm, Detlef Rudolph wrote: > > I've tried the VACUUM ANALYSE, that doesn't help > much, but VACUUM FULL improves Performance down > from about 40 secs to 8. =20 Det, =20 I don't think anyone meant to suggest that VACUUM ANALYZE would improve = the count speed on a table which had become bloated, but its routine use would PREVENT a table from becoming bloated. Once bloat occurs, you need more agressive maintenance, like VACUUM FULL or CLUSTER. =20 VACUUM FULL tends to cause index bloat, so you will probably see performanc= e issues in other queries at the moment. You will probably need to REINDEX the table or use CLUSTER to clean that up. =20 -Kevin =20