statistic: limit the calls to the database in check_if_failed