Re: [ADMIN] Fast Deletion For Large Tables

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: Nikolaus Dilger <nikolaus(at)dilger(dot)cc>
Cc: raymond(dot)chui(at)noaa(dot)gov, pgsql-admin(at)postgresql(dot)org, pgadmin-support(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [ADMIN] Fast Deletion For Large Tables
Date: 2002-10-16 16:10:32
Message-ID: 20021016161031.GA17094@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-admin pgsql-general

On Sat, Oct 05, 2002 at 08:17:38PM -0700, Nikolaus Dilger wrote:
> Raymond,
>
> 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.
>
> Unfortunately you also cannot use a UNION ALL in a view
> to fake partitions.
>

Hmm, you haven't tried this recently, have you? With pgsql 7.2.1,
It seems to work just fine:

test=# create view transactions as select * from monday union all select * from tuesday union all select * from wednesday ;
CREATE
test=# \d transactions
View "transactions"
Column | Type | Modifiers
----------+---------+-----------
daynum | integer |
transact | integer |
View definition: (SELECT monday.daynum, monday.transact FROM monday UNION ALL SELECT tuesday.daynum, tuesday.transact FROM tuesday) UNION ALL SELECT wednesday.daynum, wednesday.transact FROM wednesday;

test=# select * from transactions;
daynum | transact
--------+----------
1 | 1
1 | 2
1 | 3
2 | 4
2 | 5
2 | 6
(6 rows)

test=#

Ross

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message lz John 2002-10-17 07:06:52 hi
Previous Message Dave Page 2002-10-16 08:32:47 Re: Problem with Locale , RE: "Runtime Error 55 File Already Open" after clicking the Databases in the tree

Browse pgsql-admin by date

  From Date Subject
Next Message Morten Guldager 2002-10-16 17:46:13 VACUUM FULL fails to free diskspace
Previous Message Devinder K Rajput 2002-10-16 13:44:31 Re: newbie qs; examining databases and tables

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Papa 2002-10-16 16:37:02 tuplestore: write failed
Previous Message Robert John Shepherd 2002-10-16 15:58:20 Re: Queries take forever on ported database from MSSQL -> Postgresql (SOLVED)