Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: moodle.org
    • Labels:
      None

      Description

      This is taking about 20 seconds - shows up 1000s of times in the slow query log:

      SELECT u.*
                              FROM user u
                              WHERE u.id IN (
                                  SELECT u2.id FROM
                                  user u2
                                  JOIN (SELECT DISTINCT eu1_u.id
                    FROM user eu1_u
                  JOIN user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
      JOIN enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = '5')
                 WHERE eu1_u.deleted = 0 AND eu1_u.id <> '153' AND eu1_ue.status = '0' AND eu1_e.status = '0' AND eu1_ue.timestart < 1415115100 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > 1415115100)) je ON je.id = u2.id
                                  LEFT JOIN forum_subscriptions s ON s.userid = u2.id
                                  LEFT JOIN forum_discussion_subs ds ON ds.userid = u2.id
                                  WHERE
                                    s.forum = '33'
                                  OR
                                    (ds.forum = '33' AND ds.preference <> '-1')
                              )
                              ORDER BY u.email ASC;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              poltawski Dan Poltawski
              Participants:
              Component watchers:
              Helen Foster
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: