Re: Very long deletion time on a 200 GB database - Mailing list pgsql-performance

From Jesper Krogh
Subject Re: Very long deletion time on a 200 GB database
Date
Msg-id 4F469783.7030201@krogh.cc
Whole thread Raw
In response to Very long deletion time on a 200 GB database  ("Reuven M. Lerner" <reuven@lerner.co.il>)
List 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

pgsql-performance by date:

Previous
From: Steve Crawford
Date:
Subject: Re: set autovacuum=off
Next
From: Jayashankar K B
Date:
Subject: Disable-spinlocks while compiling postgres 9.1 for ARM Cortex A8