Massive delete of rows, how to proceed?

From: "Peter Childs" <peterachilds(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Massive delete of rows, how to proceed?
Date: 2006-11-25 15:45:19
Message-ID: a2de01dd0611250745je59cd36v77d5c7be76601cf2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 24/11/06, Arnau <arnaulist(at)andromeiberica(dot)com> wrote:
> Hi all,
>
> I have a table with statistics with more than 15 million rows. I'd
> like to delete the oldest statistics and this can be about 7 million
> rows. Which method would you recommend me to do this? I'd be also
> interested in calculate some kind of statistics about these deleted
> rows, like how many rows have been deleted for date. I was thinking in
> creating a function, any recommendations?

Copy and drop old table. If you delete you will have a massive problem
with a bloated table and vacuum will not help unless you expect the
table to grow to this size regulally otherwise vacuum full will take
ages.

Peter.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message andrew 2006-11-26 00:35:01 Re: Massive delete of rows, how to proceed?
Previous Message Tom Lane 2006-11-25 00:10:05 Re: Postgres scalability and performance on windows