Back
Home
Up
Next

Index garbage collection.

    IB versions 4.X and earlier didn't try to shrink indices when the records in an indexed field were deleted. As a result, index size remained the same or grew according to need, but it never became smaller.

IB5 implemented garbage collection on indexes as it has been available for record versions since version 1. The size of an index is decreased dynamically if a complete index page becomes empty because all the data records they pointed at were deleted. When the manual states that less tuning is required, it means that previously, the only way to decrease an index size was dropping and creating it again. However, this trick is not possible with indices that are generated automatically, so the only escape was a backup and restore.

However, even with its new feature, IB retains the recovered disk space inside the gdb and it doesn't return it to the operating system and also, the pages remain assigned for index usage, so they cannot be used for other object types.

For index garbage collection to work, the ODS should be the main ODS of IB5.X, namely ODS9 and not the previous ODS versions that are compatible with IB5. To allow index garbage collection to occur on IB4.X databases, you need to backup and restore them with IB5's gbak, so they will be upgraded to ODS 9.

 

This page was last updated on 2001-01-16 01:40:27