optimising username and email index retrieval