Re: Problem deleting records on SE
Posted in 1998
Yes, it's absolutely normal as Informix SE just marks the records as DELETED
and then free for reuse. If you really want to free space, you just have to
drop the table and recreate it if it's empty.
If it is not, you can unload all the records to a flat ASCII file, drop the
table, recreate it, load the saved records again and create indexes.
Exemple:
UNLOAD TO "mydata.unl" SELECT * FROM mytable;
DROP TABLE mytable;
CREATE TABLE mytable;
LOAD FROM "mydata.unl" INSERT INTO mytable;CREATE [UNIQUE] [CLUSTER] INDEX idxname ON mytable( list of fields);
UPDATE STATISTICS FOR mytable;
Tips: To speed up the LOAD and CREATE INDEX statements and as far as your
database is logged, you'd better execute them inside a transaction with a
LOCK mytable IN EXCLUSIVE MODE statement (take care of the log growth rate
!!!). This tells Informix SE not to control each INSERT and let it do its
best.
Carlos wrote:
> I've deleted all records in a table, but the sizes of .dat and .idx files
> are the same as before deletion. Why?
>
> Thanks,
>
> Carlos