Re: [ADMIN] Fast Deletion For Large Tables - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: [ADMIN] Fast Deletion For Large Tables
Date
Msg-id 3DA1CFD1.15920.102CFBCC@localhost
Whole thread Raw
In response to Re: [ADMIN] Fast Deletion For Large Tables  ("Nikolaus Dilger" <nikolaus@dilger.cc>)
List pgsql-general
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.


pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: deadlock using sequences?
Next
From: Thomas O'Dowd
Date:
Subject: why isn't index used?