Re: reclaiming tblspace
Posted in 1995
>: There are two ways to do this:
>: 1) If the table has an index, use SQL to ALTER INDEX TO CLUSTER.
>: This will physically re-arrange the data in the table to match the index,
>: freeing up unused extents space along the way. This method requires free
>: dbspace >= (tablesize after purging unused rows), for the alter has to
>: physically re-create the "new" data before it can delete the "old" data.
How about
{create new table with same schema}
INSERT INTO newtable SELECT * FROM oldtable
DROP oldtable
{rebuild-indexes}
{rename newtable to oldtable (sorry, no manuals, can't remember the syntax)}
Haven't tried it myself, but it should require less space than an ALTER TABLE,
because you're just copying the data before you drop the old table, and then
all that space is freed up for re-creating the indexes. Faster than unloading
too.
June
---- June Tong Informix Asia/Pacific ----
---- On-Loan Engineer Singapore ----
---- junet@informix.com (65) 298-1716 ----