Re: full vacuum of a very large table

From: Ashish Nauriyal <ashish(dot)nauriyal(at)enterprisedb(dot)com>
To: Nic Chidu <nic(at)chidu(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: full vacuum of a very large table
Date: 2011-03-29 16:27:02
Message-ID: BANLkTin7uMWSh6kH-rccsmg3w3WHgt3FGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Mar 29, 2011 at 9:26 PM, Nic Chidu <nic(at)chidu(dot)net> wrote:

> Got a situation where a 130 mil rows (137GB) table needs to be brought down
> in size to 10 mil records (most recent)
> with the least amount of downtime.
>
>
What version of PG are you with ?
If PG>8.2 and have disk space twice the size of target table and indexes,
you can reorganize the table using pg_reorg without locking table with
concurrent selections and updations.

http://reorg.projects.postgresql.org/pg_reorg.html

> Doing a full vacuum would be faster on:
> - 120 mil rows deleted and 10 mil active (delete most of them then full
> vacuum)
> - 10 mil deleted and 120 mil active. (delete small batches and full vacuum
> after each delete).
>
> Any other suggestions?
>
> Thanks,
>
> Nic
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

--
Thanks,
Ashish Nauriyal
EnterpriseDB Corporation
The Enterprise Postgres Company

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Steve Crawford 2011-03-29 16:33:03 Re: full vacuum of a very large table
Previous Message raghu ram 2011-03-29 16:21:48 Re: full vacuum of a very large table