Re: De-fragmenting tables. Some questions
Posted in 1997
Typically, it is substantially faster to do this entirely within Informix.
create table tmp_t1.....
(^ unindexed )
insert into tmp_t1
select * from t1;
rename table tmp_t1 t1;
create index/procedure/etc.
Depending on you table fragmentation and temp DBspaces, this
should run 2-5 times faster than running the data to disk
You can add an "order by" clause to "cluster" the data.
Note that if there are any dependencies (FKs, Multi-table views,
etc.) you will need to drop these also and re-declare them.
-d
>Volker Fraenkle wrote in message <19971230.13191334@ff>...
>The easiest way to defragment a table is:
>
>- unload table to disk
>- drop table
>- create table
>- load table from disk
>- create indexes
>
>If you do not drop the table, then the reserved pages of your table
>will not be freed.
>
>You can not build a table in a special chunk. You have to create a
>seperate dbspace for it.
>
>NOTE: After reloading your table, you table locklevel is page not row!
>
>Hope that helps,
>Volker