-
Improvement
-
Resolution: Fixed
-
Minor
-
2.7.7, 2.8.5, 2.9
-
MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
suspended_userids_memory
-
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.