You should be aware of the following points when using Rebuild:
- You should make a backup copy of the file being rebuilt or reorganized before using Rebuild. Rebuild takes every precaution to prevent the original files from being corrupted, but this can happen if the parameters are wrongly specified. Additionally, the original index is overwritten, so it would be wise to preserve it in case of any subsequent problems.
- The facility to rebuild the index of an indexed file does not retain the information held in the original about free space in the data file. Consequently, this free space cannot be reused, and your file might grow bigger than necessary. To overcome this problem, reorganize the file after you have rebuilt the index, thus removing all of the free space. (Free space consists of the spaces in the data file occupied by deleted records. Information about these areas is normally retained, and the areas reused for new records as appropriate.)
- When the rebuild process is complete, the data file is changed by adding a blank free space pointer record to the end of the file. Every time you rebuild the index a new record is added. Consequently, several rebuilds, without intervening reorganizations, cause the data file to grow. Again, this problem can be relieved by reorganizing the file, causing all the free space pointer records to be removed, and a single new blank one added.