Re: rotating table question

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Roman Havrylyak <roma(at)ukr(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: rotating table question
Date: 2001-08-17 11:45:14
Message-ID: 20010817214514.A20896@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 17, 2001 at 02:29:47PM +0200, Roman Havrylyak wrote:
> Suppose we have table with indexes, attached triggers, and finnaly alot of
> records (more then 100,000). Records are adding continuously.
>
> Once a month you have to do archiving of records. Simple INSERT INTO ARCHIV
> followed by DELETE and then VACUUM take alot of time, offen even hang up
> sessions. Dropping triggers and indexes is bad due to the continuously
> adding records.
>
> Is there any ways to solve problems?

I'm not sure whether it works, it may only work with a recent release, but
wouldn't the solution be:

begin;
alter table data rename to data_archive;
create table data (...);
commit;

I think with the recent decoupling of filenames and table names that should
be possible.

--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2001-08-17 12:08:31 Re: Roll Back dont roll back counters
Previous Message Feite Brekeveld 2001-08-17 11:40:32 Re: slow update but have an index