pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Carlos Benkendorf <chbenkendorf@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Vacuum x Vacuum full
Date: Fri, 25 Jun 2004 10:28:40 -0700 (PDT)
Message-ID: <20040625101942.J32249@megazone.bigpanda.com> (raw)
In-Reply-To: <20040625164231.34710.qmail@web60305.mail.yahoo.com>
References: <20040625164231.34710.qmail@web60305.mail.yahoo.com>


On Fri, 25 Jun 2004, Carlos Benkendorf wrote:

> I would like to know if space disk is free to the Operational System
> during a standard vacuum (without the full option)?
>
> I found in section "21.1.1 Recovering disk space" of Postgresql 7.4.2 manual
> something about it.
>
> "The standard form of VACUUM is best used with the goal of maintaining a
> fairly level steady-state usage of disk space.The standard form finds
> old row versions and makes their space available for re-use within the
> table, but it does not try very hard to shorten the table file and
> return disk space to the operating system. "
>
> Even so it is not clear. They say the space will be available for re-use
> within the table so I realized the space will not be available to
> the operational system. But they also say the command "does not try very
> hard to shorten the table file and return disk space to the operating
> system" what means to me that it could sometimes free space to the
> operating system.
>
> I could not clear my doubt. Will the standard form, free disk space to the
> operational system or not?

Sometimes. If there are empty pages at the end of the file, it can attempt
to shorten the file. If there's data at the end of the file, it won't.

> I did some tests and discovered that the standard form frees disk space
> to the operational system. But if the standard form already frees it why
> the full form will do different?

Full can move tuples between pages which can free up pages at the end of
the file which can allow it to shorten further.

For example, if you insert enough rows to say have 2 pages in your table
file and delete all the entries on the first page and not quite all on the
second, vacuum (nonfull) is not going to be able to truncate the file
because the data is in the second page.  Vacuum full will move live rows
to the first page freeing up the entire second page and making it
available for release.



view thread (3+ messages)  latest in thread

Message-ID: <20040625101942.J32249@megazone.bigpanda.com>
Permalink:  ../20040625101942.J32249@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040625101942.J32249@megazone.bigpanda.com

 · 

reply

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: sszabo@megazone.bigpanda.com, chbenkendorf@yahoo.com
  Subject: Re: Vacuum x Vacuum full
  In-Reply-To: <20040625101942.J32249@megazone.bigpanda.com>
  References: <20040625164231.34710.qmail@web60305.mail.yahoo.com> <20040625101942.J32249@megazone.bigpanda.com>

* 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