Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49395

Make get_suspended_userids more efficient

    XMLWordPrintable

    Details

      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.

        Attachments

          Activity

            People

            Assignee:
            tlevi Tony Levi
            Reporter:
            tlevi Tony Levi
            Peer reviewer:
            Dave Cooper
            Integrator:
            Andrew Nicols
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/May/15