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

Use temporary tables in sync_users of external database authentication

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.0
    • Authentication, Performance
    • Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz, 4GB RAM,Linux, MySQL with tunned configurations, Apache 2,
    • MOODLE_20_STABLE

      Here at Universidade Federal de Santa Catarina we are starting the upgrade of our infra-structure to 2.0 and our first major goal is to sync users from the academic control system.
      In Moodle 1.9 we use a custom system, developed from beggining, and with a lot of features. One of these is to create users in Moodle from a table, and now we know that Moodle's External Database Authetication plugin can do the work, but it is not that "performatic".
      As the documentation says, it uses arrays to calculate the set of users to be created, instead of a temporary table and a left join like what is done in ldap plugin.
      This patch i am submitting changes this behaviour and introduces the temporary table in the proccess. A lot of duplicated code from ldap, that we may think about refactor.
      I haven't tested the original process, but the new one can calculate the users to create in almost zero time in a fresh install (just 2 or 3 records in user table) and it took about 5 minutes to calculate the set with 38K records in the external table that were already in moodle.
      Also, the update process can be a lot improved. The current code does an update for each user, that consists of one SELECT and N updates, where N is the number of update keys. I don't have numbers but should be better to construct only one UPDATE TABLE query and let the database calculate which records differ. This is valid for remove/suspend process too.

            moodle.com Moodle HQ
            danielneis Daniel Neis Araujo
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.