Last active
December 26, 2015 09:49
-
-
Save danpoltawski/7132055 to your computer and use it in GitHub Desktop.
slow query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT u.id | |
| FROM mdl_user u | |
| JOIN (SELECT DISTINCT eu1_u.id | |
| FROM mdl_user eu1_u | |
| JOIN mdl_role_assignments eu1_ra3 ON (eu1_ra3.userid = eu1_u.id AND eu1_ra3.roleid IN (5) AND eu1_ra3.contextid IN (1,236,15,152)) | |
| JOIN mdl_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id | |
| JOIN mdl_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = $1) | |
| WHERE eu1_u.deleted = 0 AND eu1_u.id <> $2 AND eu1_ue.status = $3 AND eu1_e.status = $4 AND eu1_ue.timestart < $5 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > $6)) je ON je.id = u.id | |
| WHERE u.deleted = 0 ORDER BY u.lastname, u.firstname, u.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment