Some query returns empty result and it becomes bottle neck