Optimize name search.