Optimize indexing process.