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

Absurdly slow capabilities query

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 2.6.11, 2.7.8, 2.8.6, 2.9
    • Performance
    • MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Easy

      Our mdl_role_capabilities table has half a million rows in it and the login process can only handle about 5 students logging in at once...

      Our experiments show that changing UNION to UNION ALL here:

      https://github.com/moodle/moodle/blob/master/lib/accesslib.php#L890

      Makes the query run 40% faster. Could this be considered for upcoming Moodle point releases?

      The final ORDER BY should be removed too for another 40% improvement but related code claims the order is actually important somehow :/

            rajeshtaneja Rajesh Taneja
            chriskl Chris Kings-Lynne
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

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