To optimize space and disk utilization, call IDBFunction with OPTIMIZE as its parameter. IDBFunction dumps the word, document, and reference information from the existing index files into a temporary set. These lists are then re-ordered to give the best subsequent access profile. The old index is re-initialized and the word, document, and reference information is read back into the index. OPTIMIZE optimizes an index for speed and space. If an index has been subject to a great deal of maintenance or has had a large amount of de-indexing performed upon it, some free space may be created within the index files (the Stats command shows you the amount of free space). Performing an OPTIMIZE reclaims this free space, as well as arranging logically contiguous sections of the index so that they are also physically contiguous. It is a good idea to OPTIMIZE when your free space gets too high (although you may find that a complete Reindex will execute more quickly). You should also OPTIMIZE when an index is not going to have any further maintenance performed on it, i.e. ADD or UPDATE functions, and you want to ensure the index is optimally organized. |