-
Bug
-
Resolution: Fixed
-
Major
-
2.0.1
-
MOODLE_20_STABLE
-
MOODLE_20_STABLE
-
Easy
The course_overview block has a major performance flaw which is causing it to call rebuild_course_cache() for each and every course it displays. For a normal student with 4 courses on their page, this resulted in over 3000 database queries! This does not just happen once - it happens every time My Moodle page loads for any user.
I have attached a patch with a very simple fix. The course_overview block was not passing the modinfo attribute with the course objects when it passes them to print_overview(). This causes print_overview() to think the course has no modinfo cache and thus it goes off an rebuilds it all.
In my test case, the number of DB queries went from 3474 down to 90.