Updated method shouldUseIndex