Optimize indexing