Re: database size after a DELETE and VACUUM

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Mike(dot)Samson(at)apcc(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: database size after a DELETE and VACUUM
Date: 2005-07-03 14:23:38
Message-ID: 20050703142337.GA39504@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, Jul 01, 2005 at 09:30:50AM -0400, Mike(dot)Samson(at)apcc(dot)com wrote:
>
> I would expect the database size to decrease after the VACUUM.

Note what the documentation says about VACUUM and recovering disk
space:

http://www.postgresql.org/docs/8.0/static/maintenance.html#VACUUM-FOR-SPACE-RECOVERY

"There are two variants of the VACUUM command. The first form,
known as 'lazy vacuum' or just VACUUM, marks expired data in tables
and indexes for future reuse; it does not attempt to reclaim the
space used by this expired data immediately. Therefore, the table
file is not shortened, and any unused space in the file is not
returned to the operating system. This variant of VACUUM can be
run concurrently with normal database operations."

"The standard form of VACUUM is best used with the goal of maintaining
a fairly level steady-state usage of disk space. If you need to
return disk space to the operating system you can use VACUUM FULL --
but what's the point of releasing disk space that will only have
to be allocated again soon?"

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Christopher Browne 2005-07-03 17:49:11 Re: database size after a DELETE and VACUUM
Previous Message Tom Lane 2005-07-02 13:52:32 Re: Help needed to set the Optimal Value for shared_buffers.