Re: Running vacuum after delete does not remove all space allocated

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Chris Barnes <compuguruchrisbarnes(at)hotmail(dot)com>
Cc: Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Running vacuum after delete does not remove all space allocated
Date: 2010-03-31 19:46:56
Message-ID: g2idcc563d11003311246wd6647af1v16ffc081c6261be5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 31, 2010 at 12:44 PM, Chris Barnes
<compuguruchrisbarnes(at)hotmail(dot)com> wrote:
> I have deleted the rows in a table and vacuumed full, there appears to be
> space allocated that after a truncate it removes.
>
> Why is this?

It's how PostgreSQL is designed. It recycles the space at a later
time, after vacuum has reclaimed the empty space and it puts new data
from inserts and updates into the now free space. More efficient then
allocating and de-allocating all the time, and lowers fragmentation.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sylvain Lara 2010-03-31 20:22:40 Re : Select in temporary table
Previous Message Bill Moran 2010-03-31 19:33:51 Re: Select in temporary table