Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.7.7, 2.8.5, 2.9
-
Component/s: Enrolments, Performance
-
Testing Instructions:
-
Affected Branches:MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
Fixed Branches:MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
Pull from Repository:
-
Pull Master Branch:suspended_userids_memory
-
Pull Master Diff URL:
Description
The get_suspended_userids function is quite inefficient in a couple of ways:
1) It uses memory proportional to the number of enrolled users in a context
2) Multiple calls to expensive get_enrolled_sql
We have some code trying to call this from the frontpage; this doesn't work as ALL user records are returned (with help of get_enrolled_sql) and evaluated in get_suspended_userids.
My change allows get_enrolled_sql to return only suspended users, and makes get_suspended_userids take that path, as well as switching to fieldset (less RAM per record), and adding a fast path for the front page.