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 9D006D1B558 for ; Thu, 11 Sep 2003 20:38:28 +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 11762-08 for ; Thu, 11 Sep 2003 17:38:18 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 06721D1B52B for ; Thu, 11 Sep 2003 17:38:17 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h8BKcCsl050734 for ; Thu, 11 Sep 2003 20:38:12 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h8BKA0CZ042645 for pgsql-admin@postgresql.org; Thu, 11 Sep 2003 20:10:00 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Does VACUUM ever free up any disk space? Date: Thu, 11 Sep 2003 15:17:17 -0400 Organization: Hub.Org Networking Services Lines: 38 Message-ID: <601xunw2wy.fsf@dev6.int.libertyrms.info> References: <3F60B401.2050201@psychofx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:upHaP4stThHXoOIUFS67+8UKaNw= To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/235 X-Sequence-Number: 10323 chris_pg002@psychofx.com (Chris Miles) writes: > 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? Yes, VACUUM surely can and does. [extract from recent vacuum on a fairly busy system running 7.2.4] NOTICE: --Relation pg_class-- NOTICE: Index pg_class_oid_index: Pages 11369; Tuples 173: Deleted 944. CPU 2.60s/0.45u sec elapsed 3.36 sec. NOTICE: Index pg_attribute_relid_attnam_index: Pages 12928; Tuples 4248: Deleted 1400. CPU 3.85s/0.79u sec elapsed 5.37 sec. NOTICE: Index pg_attribute_relid_attnum_index: Pages 4220; Tuples 4268: Deleted 1400. CPU 1.27s/0.27u sec elapsed 2.14 sec. NOTICE: Removed 1400 tuples in 24 pages. CPU 0.00s/0.03u sec elapsed 0.37 sec. NOTICE: Pages 295: Changed 0, Empty 0; Tup 4168: Vac 1400, Keep 0, UnUsed 1. Total CPU 5.17s/1.13u sec elapsed 7.99 sec. NOTICE: Truncated 295 --> 57 pages. CPU 0.17s/0.02u sec elapsed 0.34 sec. NOTICE: --Relation pg_class-- Apparently pg_class will need to get reindexed at some point, as there are more pages than there are live tuples, but notice that this Plain Old Vacuum truncated the table itself down from 295 pages to 57 pages. ANALYZE has nothing to do with this; ANALYZE modifies statistics in pg_statistic, which will usually have the effect of adding some "garbage" to that table. -- (reverse (concatenate 'string "ofni.smrytrebil" "@" "enworbbc")) Christopher Browne (416) 646 3304 x124 (land)