From: Ashish Nauriyal <ashish.nauriyal@enterprisedb.com>
To: Nic Chidu <nic@chidu.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: full vacuum of a very large table
Date: Tue, 29 Mar 2011 21:57:02 +0530
Message-ID: <BANLkTin7uMWSh6kH-rccsmg3w3WHgt3FGw@mail.gmail.com> (raw)
In-Reply-To: <1301414165.2351.1435136873@webmail.messagingengine.com>
References: <1301414165.2351.1435136873@webmail.messagingengine.com>
On Tue, Mar 29, 2011 at 9:26 PM, Nic Chidu <nic@chidu.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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
--
Thanks,
Ashish Nauriyal
EnterpriseDB Corporation
The Enterprise Postgres Company
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: ashish.nauriyal@enterprisedb.com, nic@chidu.net
Subject: Re: full vacuum of a very large table
In-Reply-To: <BANLkTin7uMWSh6kH-rccsmg3w3WHgt3FGw@mail.gmail.com>
References: <1301414165.2351.1435136873@webmail.messagingengine.com> <BANLkTin7uMWSh6kH-rccsmg3w3WHgt3FGw@mail.gmail.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