pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: pgsql-admin@postgresql.org
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Fast Deletion For Large Tables
Date: Mon, 07 Oct 2002 18:17:53 +0530
Message-ID: <3DA1CFD1.15920.102CFBCC@localhost> (raw)
In-Reply-To: <20021005201740.20309.h016.c001.wm@mail.dilger.cc.criticalpath.net>

On 5 Oct 2002 at 20:17, Nikolaus Dilger wrote:
> Partitioned tables would solve your issue since you
> could just truncate a partiotion in order to delete the
> unneeded data.  Unfortunately they are not available in
> PostgreSQL.  But maybe in a future release.

If you don't mind realigning your schema, inheriting tables can closely mimick 
partitions upto certain extent.

Reading the original post below, I recommend you to consider inheritance 
approach. Create a base table which is empty and create inherited partitions. 
You can get all the data in child table by querying upon base table. So your 
application would not require any modification as long as selecting data is 
considered.

You have to write a wrapper on insert/update/delete code to operate upon a 
particular partition.

> There is no rowid in PostgreSQL.  So while adding an
> additional column with a sequence would help as long as
> you have an index.  Just indexing your date column
> maybe easier.  But then you pay with slower inserts or
> the time and effort to build the index.

There is oid and if you don't use it you can disable it saving some space if 
you have large data.

HTH

Bye
 Shridhar

--
Bachelor:	A man who chases women and never Mrs. one.




view thread (9+ messages)  latest in thread

Message-ID: <3DA1CFD1.15920.102CFBCC@localhost>
Permalink:  ../3DA1CFD1.15920.102CFBCC@localhost/
Also on:    postgresql.org/message-id/3DA1CFD1.15920.102CFBCC@localhost

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: shridhar_daithankar@persistent.co.in, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] Fast Deletion For Large Tables
  In-Reply-To: <3DA1CFD1.15920.102CFBCC@localhost>
  References: <20021005201740.20309.h016.c001.wm@mail.dilger.cc.criticalpath.net> <3DA1CFD1.15920.102CFBCC@localhost>

* 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