X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2DA51D1B506 for ; Thu, 11 Sep 2003 18:27:47 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 91644-03 for ; Thu, 11 Sep 2003 15:27:17 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id C5938D1B548 for ; Thu, 11 Sep 2003 15:27:15 -0300 (ADT) Received: (qmail 19406 invoked by uid 500); 11 Sep 2003 18:33:44 -0000 Date: Thu, 11 Sep 2003 13:33:44 -0500 From: Bruno Wolff III To: Chris Miles Cc: pgsql-admin@postgresql.org Subject: Re: Does VACUUM ever free up any disk space? Message-ID: <20030911183344.GA18859@wolff.to> Mail-Followup-To: Chris Miles , pgsql-admin@postgresql.org References: <3F60B401.2050201@psychofx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F60B401.2050201@psychofx.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/189 X-Sequence-Number: 10277 On Thu, Sep 11, 2003 at 18:42:25 +0100, Chris Miles wrote: > I've read a lot where people recommend using VACUUM FULL > to free up disk space, especially after many updates/inserts. > > But does a regular VACUUM (or VACUUM ANALYSE) ever free up > any space? > > 24/7 production databases cannot be locked for long periods > of time to run VACUUM FULL, but I do not want data files > growing indefinitely (any more than they need to) so I hope > the routine VACCUM ANALYSE will take care of this. Vacuum full actually shrinks the file sizes. A normal vacuum just marks free areas in the files so that they can be reused. If you regularly do a normal vacuum your database should have a steady state size with some of the disk space taken up by free space. If something unusual happens and the database grows much bigger than it needs to be, you can then use vacuum full to reclaim space. If your FSM setting is too low, your normal vacuums won't mark all of the free space and this can result in continual growth of the database files. You also have to worry about index growth. In versions prior to 7.4 btree indexes would not reuse space when the index values were montonicly increasing. This isn't a problem for everyone, but is for some. In 7.4 things work much better.