Reduce sql queries when showing statuses in problem index page