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

Poor performance on Moodle User Log report using Standard Log

XMLWordPrintable

    • 2
    • International 3.9 - Sprint 3

      Issue: The Moodle User Log report using Standard Log is poor performing when the course has a large number of enrolled users and lots of activity.

      Example of note:
      mdl_logstore_standard_log size of 30372477 records

      We have noticed that when a course has thousands of enrollments and course activity that generates logs record in the upwards of 40,000 records that the Moodle User Log Report (/report/log/user.php) for that couse is taking taking minutes to generate. By comparison it only takes 2 seconds to bring a comparable report up using the Legacy Logs setting.

      We found the SQL in the report that causes the issue:

       SELECT * FROM mdl_logstore_standard_log WHERE courseid = '????' AND userid = '????' AND anonymous = 0 ORDER BY timecreated DESC, id DESC LIMIT 0, 100 

      In testing we applied added a temporary index and it resolved the performance issue:

        create index quick_test on mdl_logstore_standard_log (courseid, userid, timecreated); 

      Possibly in relation to what was done in MDL-44998

            lameze Simey Lameze
            kmccarthy Kevin McCarthy
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 2 minutes
                5h 2m

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