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

Performance improvements for user / group overrides for mod assign

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Build a Moodle site with large number of user records, about 150 000 users   (In my case there are 570 000 users)

      1. Create a course
      2. Create two groups
      3. Enrol and Add around 100 users into each groups
      4. Create an assignment
      5. Create assignment override for each group
      6. Load the grading page (mod/assign/view.php?action=grading&id=...)
      7. The page is loaded really slow (around 1 minutes or more)
      8. Apply the patch
      9. Reload the page, it should be much faster (depends on the number of users in the course, not the whole site)
      Show
      Build a Moodle site with large number of user records, about 150 000 users   (In my case there are 570 000 users) Create a course Create two groups Enrol and Add around 100 users into each groups Create an assignment Create assignment override for each group Load the grading page (mod/assign/view.php?action=grading&id=...) The page is loaded really slow (around 1 minutes or more) Apply the patch Reload the page, it should be much faster (depends on the number of users in the course, not the whole site)
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-65797-Master

      Description

      At scale the hairy sql here performs really badly, eg minutes to load the grading UI:

      https://github.com/moodle/moodle/blob/master/mod/assign/gradingtable.php#L172-L236

      Some combination of sql rewrite or indexing needed.

       

        Attachments

        1. currentquery_plan.png
          446 kB
          Nathan Nguyen
        2. currentquery.png
          142 kB
          Nathan Nguyen
        3. querywithuserlimit_plan.png
          397 kB
          Nathan Nguyen
        4. querywithuserlimit.png
          144 kB
          Nathan Nguyen

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 30 minutes
                  3h 30m