Re: Fast Deletion For Large Tables - Mailing list pgsql-admin

From Ross J. Reedstrom
Subject Re: Fast Deletion For Large Tables
Date
Msg-id 20021016161031.GA17094@rice.edu
Whole thread Raw
In response to Re: Fast Deletion For Large Tables  ("Nikolaus Dilger" <nikolaus@dilger.cc>)
List pgsql-admin
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
FROMtuesday) 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

pgsql-admin by date:

Previous
From: "Devinder K Rajput"
Date:
Subject: Re: newbie qs; examining databases and tables
Next
From: Morten Guldager
Date:
Subject: VACUUM FULL fails to free diskspace