Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the performance of the database query in the user_results tag
The commit a6c1ea7 tried to optimize the submitter statistics in the results page (Your points). However, the database query in the `user_results` template tag was too slow on courses with hundreds of students and thousands of submissions. The order of `filter()` and `annotate()` affects the results, that is, they are not commutative. The new version in this commit seems to work correctly and performs quite well. https://docs.djangoproject.com/en/3.2/topics/db/aggregation/#order-of-annotate-and-filter-clauses
- Loading branch information