Improve all results page performance by a new cache table for best ex… - #1539
Draft
sayravai wants to merge 1 commit into
Draft
Improve all results page performance by a new cache table for best ex…#1539sayravai wants to merge 1 commit into
sayravai wants to merge 1 commit into
Conversation
…ercise points per student.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ercise points per student.
Description
What?
Currently the All results page may not load at all for large courses, as there will be a server timeout while waiting for the results. The slowness is due to the database operations required to gather the best submissions per each student, so this PR introduces a caching table for the points of best submissions for each student/exercise. These values can be read directly from this cache table, so the All results page loads magnitudes faster. The downside is, that the cache table needs to be written on every submission, which may get slow due to the required index updates. I'm submitting this PR as draft so the performance can be further tested before deciding whether this approach is suitable for our use case.
There is a helper script (exercise/management/commands/backfill_exercise_user_points.py) for populating a cache table from an existing database. This needs to be run before testing.
Fixes #
Testing
Remember to add or update unit tests for new features and changes.
What type of test did you run?
[ADD A DESCRIPTION ABOUT WHAT YOU TESTED MANUALLY]
Did you test the changes in
Think of what is affected by these changes and could become broken
Translation
Programming style
Have you updated the README or other relevant documentation?
Is it Done?
Clean up your git commit history before submitting the pull request!