Performance optimizations for calculating the number of runs and the total points of the runs of the problem to be calculated in the DB