pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: Sven Willenberger <sven@dmv.com>
Subject: Re: Inheritence versus delete from
Date: Wed, 02 Mar 2005 01:56:52 +0100
Message-ID: <42250F54.8060508@bigfoot.com> (raw)
In-Reply-To: <1109635153.4620.44.camel@lanshark.dmv.com>
References: <1109635153.4620.44.camel@lanshark.dmv.com>

Sven Willenberger wrote:
> Trying to determine the best overall approach for the following
> scenario:
> 
> Each month our primary table accumulates some 30 million rows (which
> could very well hit 60+ million rows per month by year's end). Basically
> there will end up being a lot of historical data with little value
> beyond archival.
> 
> The question arises then as the best approach of which I have enumerated
> three:
> 
> 1) Just allow the records to accumulate and maintain constant vacuuming,
> etc allowing for the fact that most queries will only be from a recent
> subset of data and should be mostly cached.
> 
> 2) Each month:
> SELECT * INTO 3monthsago_dynamically_named_table FROM bigtable WHERE
> targetdate < $3monthsago;
> DELETE FROM bigtable where targetdate < $3monthsago;
> VACUUM ANALYZE bigtable;
> pg_dump 3monthsago_dynamically_named_table for archiving;


In my experience copy/delete in a single transaction 60+ million rows
is not feseable, at least on my 1 GB ram, 2 way CPU box.



Regards
Gaetano Mendola




view thread (6+ messages)

Message-ID: <42250F54.8060508@bigfoot.com>
Permalink:  ../42250F54.8060508@bigfoot.com/
Also on:    postgresql.org/message-id/42250F54.8060508@bigfoot.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mendola@bigfoot.com, sven@dmv.com
  Subject: Re: Inheritence versus delete from
  In-Reply-To: <42250F54.8060508@bigfoot.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox