Re: Reducing size of .dat and .idx in SE5.02
Posted in 1996
When you do either an ALTER TABLE or an ALTER INDEX which is not a no-op, then the table is rebuilt in a new file, and it is assigned a new Tabid in SysTables. The no-ops occur when you change the NOT-NULL-ness of a column, or if you change an index from CLUSTER to NOT CLUSTER. On the other hand, if you add a column, drop a column, change the length of a character column, change the type of a column (eg FLOAT to DECIMAL), or make an index clustered, the table is rebuilt in new files, and the old files are dropped, thus resizing the C-ISAM files which store it. Thus the import/export route is not necessary, as long as you have enough disk space for the second copy of the table (and its indexes). Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: Dan Michaelis <dcmichae@accessus.net> }Date: 4 Mar 1996 23:27:27 GMT }X-Informix-List-Id: <news.21741> } }Noel, } }Unfortunately, I don't think that the alter statement (either for the }data or for the index) will help much. The standard engine will not }reduce the size of the file unless the table is dropped and rebuilt. On }the positive side, if you anticipate that the file will grow again, the }space is already allocated, so it won't get bigger until it has reached }its current size. } }Probably not what you wanted to hear, but I think that the import/export }is the only way to go... } }-- Dan