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

core_user_get_users web service SQL queries do not consider indexes

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.11.4
    • None
    • Web Services
    • None
    • MOODLE_311_STABLE

    Description

      Code is in user/externallib.php, function get_users

      For example, when searching on the username, the generated SQL is something like...

      SELECT * FROM mdl_user WHERE deleted = 0 AND username = 'fred' ORDER BY id ASC;

      This is not indexed and (again, for example) on my site takes nearly a minute. This query should also use the default mnet id to take advantage of the index. 

      On large sites, this web service can be very slow. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            howardsmiller Howard Miller
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: