Performance optimization for search.