Possible distance search optimization