Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DB2DB650164 for ; Fri, 22 Aug 2008 19:44:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 88292-09 for ; Fri, 22 Aug 2008 19:44:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by postgresql.org (Postfix) with ESMTP id BC6ED64FF8E for ; Fri, 22 Aug 2008 19:44:12 -0300 (ADT) Received: from working (198-144-37-131.static.vdsl.nidhog.net [198.144.37.131]) (AUTH: LOGIN wmoran, SSL: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Fri, 22 Aug 2008 18:44:09 -0400 id 0005641B.0000000048AF4139.0000B7AD Date: Fri, 22 Aug 2008 18:44:07 -0400 From: Bill Moran To: "Fernando Hevia" Cc: pgsql-performance@postgresql.org Subject: Re: Big delete on big table... now what? Message-Id: <20080822184407.37155367.wmoran@collaborativefusion.com> In-Reply-To: <042c01c90496$ca8725f0$8f01010a@iptel.com.ar> References: <042c01c90496$ca8725f0$8f01010a@iptel.com.ar> Organization: Collaborative Fusion Inc. X-Mailer: Sylpheed 2.5.0 (GTK+ 2.12.11; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/288 X-Sequence-Number: 31169 "Fernando Hevia" wrote: > > Hi list. > =20 > I have a table with over 30 million rows. Performance was dropping steadi= ly > so I moved old data not needed online to an historic table. Now the table > has about 14 million rows. I don't need the disk space returned to the OS > but I do need to improve performance. Will a plain vacuum do or is a vacu= um > full necessary? > =BFWould a vacuum full improve performance at all? If you can afford the downtime on that table, cluster would be best. If not, do the normal vacuum and analyze. This is unlikely to improve the performance much (although it may shrink the table _some_) but regular vacuum will keep performance from getting any worse. You can also reindex pretty safely. Any queries that run during the reindex will just have to do so without the indexes. Longer term, if you remove smaller groups of rows more frequently, you'll probably be able to maintain performance and table bloat at a reasonable level with normal vacuum. --=20 Bill Moran Collaborative Fusion Inc. wmoran@collaborativefusion.com Phone: 412-422-3463x4023