query on blocks based on distance and availability