Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PERFORMANCE] [MER-4066] Dashboard optimizations #5415

Merged
merged 7 commits into from
Feb 19, 2025

Conversation

darrensiegel
Copy link
Contributor

This PR addresses a collection of performance issues in the Instructor Dashboard "Insights" tab, most prevalent in the "Practice Activities" and "Surveys" views.

There were two core performance issues:

  1. The number of queries that needed to be run to display a collection of Practice or Survey activities (for a selected page) was proportional to the number of activities. I lost track of how many "per activity" queries were made, but I think it was around 3-5 per activity.

  2. Some of the per activity queries and the non-per-activity queries run queried over the activity attempts table. For example, as a way to count the number of attempts. This is not scalable against production data.

The above two issues basically led to situations where the Practice Activities view was completely unusable for many courses in the system. You can see this right now on Proton by finding a decently large course, then trying to click on a practice page to see the activity details. The entire view just hangs.

The fix here was to re-implement the analytics gathering and preview rendering code to ensure that we:

  1. minimize the total number of queries made when a page is selected
  2. make 0 queries over any table in the attempt hierarchy
  3. make 0 queries "per activity"

So in other words, we put a constant upper bound on the number of queries made when a page is selected.

@eliknebel eliknebel merged commit 2a4a6dd into master Feb 19, 2025
5 checks passed
@eliknebel eliknebel deleted the dashboard-optimizations branch February 19, 2025 13:52
@darrensiegel darrensiegel restored the dashboard-optimizations branch February 22, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants