-
Bug
-
Resolution: Fixed
-
Minor
-
2.8.9, 2.9.3, 3.0
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
-
MOODLE_29_STABLE, MOODLE_30_STABLE
-
One of the changes introduced in MDL-28420 has caused a regression in the login performance for users. We've observed the time taken to login jump between 3~40x longer, depending on the user and the number of courses they're enrolled in.
The root cause of this is a change in one of the queries in the enrol_database sync. The JOIN to the user_enrolment table has changed to a LEFT JOIN to it. Which is otherwise fine, except that the user_enrolment join no longer has a userid filter associated with it.
Example without MDL-28420:
select count(1) from (SELECT e.*, c.visible AS cvisible, ue.status AS ustatus
|
FROM mdl_enrol e
|
JOIN mdl_user_enrolments ue ON ue.enrolid = e.id
|
JOIN mdl_course c ON c.id = e.courseid
|
WHERE ue.userid = 92774 AND e.enrol = 'database') x;
|
count
-------
43
Example with MDL-28420:
select count(1) from (SELECT e.*, c.visible AS cvisible, ue.status AS ustatus
|
FROM mdl_enrol e
|
JOIN mdl_course c ON c.id = e.courseid
|
JOIN mdl_role_assignments ra ON ra.itemid = e.id
|
LEFT JOIN mdl_user_enrolments ue ON ue.enrolid = e.id
|
WHERE ra.userid = 92774 AND e.enrol = 'database') x;
|
count
--------
126672
- is a regression caused by
-
MDL-28420 Allow Non-Enrolled "Other Users" Role Assignments to be set by "Enrol" Database Plugin
- Closed