tl-its-umich-edu / my-learning-analytics

My Learning Analytics (MyLA)
Apache License 2.0
36 stars 39 forks source link

Resource access view is slow in courses with a lot of data and users #1573

Closed jonespm closed 1 month ago

jonespm commented 5 months ago

Describe the bug (Tell us what happens instead of the expected behavior) :

In a course it a lot of data and also many users the resource access view runs really slow. This can cause the CPU on the DB to timeout.

The query identified here on resource_access is very slow and probably could be either optimized or have more indexes added. The user_id columns need to be indexed.

https://github.com/tl-its-umich-edu/my-learning-analytics/blob/0baa298eeef3479a5f6029f2fd09cdee26356c8f/dashboard/views.py#L301

Steps to Reproduce :

  1. Go to resource access in a course with a lot of data
  2. The view should load quickly
jennlove-um commented 2 weeks ago

Resources access loads significantly faster in myla-beta for a course with lots of resources. testing passes in beta