Skip site navigation (1) Skip section navigation (2)

Re: full vacuum of a very large table

From: "Plugge, Joe R(dot)" <JRPlugge(at)west(dot)com>
To: Nic Chidu <nic(at)chidu(dot)net>, "pgsql-admin(at)postgresql(dot)org"<pgsql-admin(at)postgresql(dot)org>
Subject: Re: full vacuum of a very large table
Date: 2011-03-29 16:04:33
Message-ID: BD69807DAE0CE44CA00A8338D0FDD08302F6C1D9CE@oma00cexmbx03.corp.westworlds.com (view raw or flat)
Thread:
Lists: pgsql-admin
Personally, provided you have the room, I would build a new table off to the side and then migrate what you need to keep to the new table, when done, and satisfied that you have all of the candidate rows, ranem the original to table to "x_tablename" and rename the newly created table into place to take over.... if all is good .. simply drop the x_tablename table.

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Nic Chidu
Sent: Tuesday, March 29, 2011 10:56 AM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] full vacuum of a very large table

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. 

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

In response to

Responses

pgsql-admin by date

Next:From: raghu ramDate: 2011-03-29 16:21:48
Subject: Re: full vacuum of a very large table
Previous:From: Nic ChiduDate: 2011-03-29 15:56:05
Subject: full vacuum of a very large table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group