Re: VACUUM FULL doesn't reduce table size

From: Vick Khera <vivek(at)khera(dot)org>
To: pinker <pinker(at)onet(dot)eu>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: VACUUM FULL doesn't reduce table size
Date: 2015-03-06 19:54:14
Message-ID: CALd+dcfDtydsO7fdR_so0ZhRFhSeQ0vg3NCkp+CUpYemhfWyAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 6, 2015 at 5:59 AM, pinker <pinker(at)onet(dot)eu> wrote:

> I have deleted a large number of records from my_table, which originally
> had
> 288 MB. Then I ran vacuum full to make the table size smaller. After this
> operation size of the table remains the same, despite of the fact that
> table
>

If your remaining records were in say, block 2 and block 10000, then the
blocks in between won't be returned to the system.

You could achieve your "fix" by running cluster on the table, which will
rewrite the table in-place. There are also scripts out there that do
in-place compaction by running targeted updates and vacuum commands to get
the empty pages at the end of the files truncated off the file.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-03-06 19:55:42 Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists
Previous Message Adrian Klaver 2015-03-06 19:31:16 Re: pg_upgrade failing from 9.3 to 9.4 because "template0" already exists