Since this method is joining QUIZ on SUBMISSION, it looks like this query will return all the fields associated with both models, which isn't really needed to count up the total results. All it needs is the submission status and quiz ID. If there's student-provided data attached to each submission, this could significantly hurt the performance of this method (or at least use way more memory and network bandwidth than is required). In 99% of the cases, this is probably fine, but just something worth considering.