Re: Fast Deletion For Large Tables

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: Fast Deletion For Large Tables
Дата
Msg-id 20021016161031.GA17094@rice.edu
обсуждение исходный текст
Ответ на Re: Fast Deletion For Large Tables  ("Nikolaus Dilger" <nikolaus@dilger.cc>)
Список 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 по дате отправления:

Предыдущее
От: "Devinder K Rajput"
Дата:
Сообщение: Re: newbie qs; examining databases and tables
Следующее
От: Morten Guldager
Дата:
Сообщение: VACUUM FULL fails to free diskspace