Re: Very long deletion time on a 200 GB database

From: Jesper Krogh <jesper(at)krogh(dot)cc>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Very long deletion time on a 200 GB database
Date: 2012-02-23 19:46:11
Message-ID: 4F469783.7030201@krogh.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 23/02/12 09:39, Reuven M. Lerner wrote:
> Hi, everyone. I'm maintaining an application that exists as a "black
> box" in manufacturing plants. The system is based on Windows, .NET,
> and PostgreSQL 8.3. I'm a Unix kind of guy myself, but the
> application layer and system administration are being handled by other
> people; I'm just the PostgreSQL guy.

Just thinking loud. It looks like (just guessing)
that the application needs store data worth 1 month back and
it was put into production under the assumption that it would
never fill up or deletion easily could be done under maintaince
windows. And that now turns out not to be the case.

I would stuff in a trigger function on the table that automatically
does the cleanup.. It could be a BEFORE INSERT OR UPDATE
TRIGGER that just tries to prune 2-3 rows of the table if they
have exceeded the keep-back time. Just installing that in the
maintance window would allow the system to self-heal over time.

If the maintaince window allows for more cleanup, then manually
do some deletions. Now the black-box is self-healing.

--
Jesper

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jayashankar K B 2012-02-23 20:14:30 Disable-spinlocks while compiling postgres 9.1 for ARM Cortex A8
Previous Message Steve Crawford 2012-02-23 19:26:55 Re: set autovacuum=off