From: Christopher Browne <cbbrowne@libertyrms.info>
To: pgsql-admin@postgresql.org
Subject: Re: Does VACUUM ever free up any disk space?
Date: Thu, 11 Sep 2003 15:17:17 -0400
Message-ID: <601xunw2wy.fsf@dev6.int.libertyrms.info> (raw)
References: <3F60B401.2050201@psychofx.com>
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"))
<http://dev6.int.libertyrms.com/;
Christopher Browne
(416) 646 3304 x124 (land)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: cbbrowne@libertyrms.info
Subject: Re: Does VACUUM ever free up any disk space?
In-Reply-To: <601xunw2wy.fsf@dev6.int.libertyrms.info>
References: <3F60B401.2050201@psychofx.com> <601xunw2wy.fsf@dev6.int.libertyrms.info>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox