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

Optimize lesson report for large data sets

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.8.3
    • Fix Version/s: None
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide

      (If xhprof and profiling is setup and run on the report it will highlight that the bottle neck is report.php)
      Run the lesson report overview.
      Apply the patch.
      Run the lesson report overview again.
      It should complete much faster after the changes.

      Show
      (If xhprof and profiling is setup and run on the report it will highlight that the bottle neck is report.php) Run the lesson report overview. Apply the patch. Run the lesson report overview again. It should complete much faster after the changes.
    • Affected Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49121_master_optimize_lesson_report

      Description

      The lesson report overview would not complete in a course with a large number of users. The problem course has around 14,000 users and 60,000 attempts for the given lesson. The report would complete if given enough time. I removed the limits and had it complete in around 15 minutes. The report winds up outputting around 27,000 rows of user attempts.

      With some optimizations I got the report to finish in less than 30 seconds.
      I was able to remove the use DISTINCT in the reports SQL. I fetch both the users and attempts at once using a JOIN and a GROUP BY.

      The lesson tools data structure is not good but that's a whole other issue.

        Attachments

          Activity

            People

            Assignee:
            swit Matthew G. Switlik
            Reporter:
            swit Matthew G. Switlik
            Integrator:
            Dan Poltawski
            Tester:
            Damyon Wiese
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: