Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id AB4C89FA0D1 for ; Mon, 24 Sep 2007 12:33:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 15799-04 for ; Mon, 24 Sep 2007 12:33:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail3.ecircle.de (mail3.ecircle.de [195.140.186.206]) by postgresql.org (Postfix) with ESMTP id 298BD9F9F84 for ; Mon, 24 Sep 2007 12:33:29 -0300 (ADT) Received: from einstein.muc.ecircle.de (einstein.muc.ecircle.de [192.168.1.7]) by mail3.ecircle.de (READY) with ESMTP id 4391A11C086; Mon, 24 Sep 2007 17:33:28 +0200 (CEST) Received: from [192.168.1.91] ([192.168.1.91]) by einstein.muc.ecircle.de with Microsoft SMTPSVC(6.0.3790.1830); Mon, 24 Sep 2007 17:33:27 +0200 Subject: Re: select count(*) performance (vacuum did not help) From: Csaba Nagy To: =?ISO-8859-1?Q?G=E1bor?= Farkas Cc: Heikki Linnakangas , pgsql-performance@postgresql.org In-Reply-To: <46F7D453.4050908@nekomancer.net> References: <46F7C494.1050604@nekomancer.net> <46F7C9F1.1080805@enterprisedb.com> <46F7D207.3000901@nekomancer.net> <46F7D2C7.70105@enterprisedb.com> <46F7D453.4050908@nekomancer.net> Content-Type: text/plain; charset=UTF-8 Date: Mon, 24 Sep 2007 17:34:16 +0200 Message-Id: <1190648056.4661.251.camel@PCD12478> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 24 Sep 2007 15:33:27.0631 (UTC) FILETIME=[40B7C5F0:01C7FEC0] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/426 X-Sequence-Number: 26971 On Mon, 2007-09-24 at 17:14 +0200, G=C3=A1bor Farkas wrote: > will i achieve the same thing by simply dropping that table and=20 > re-creating it? If you have an index/PK on that table, the fastest and most useful way to rebuild it is to do CLUSTER on that index. That will be a lot faster than VACUUM FULL and it will also order your table in index order... but it will also lock it in exclusive mode just as VACUUM FULL would do it. If your table has just a few live rows and lots of junk in it, CLUSTER should be fast enough. With 20K entries I would expect it to be fast enough not to be a problem... Cheers, Csaba.