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

Performance improvements for user / group overrides for mod assign

    XMLWordPrintable

Details

    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_38_STABLE
    • MDL-65797-Master
    • 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)

    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
          currentquery_plan.png
          446 kB
        2. currentquery.png
          currentquery.png
          142 kB
        3. querywithuserlimit_plan.png
          querywithuserlimit_plan.png
          397 kB
        4. querywithuserlimit.png
          querywithuserlimit.png
          144 kB

        Issue Links

          Activity

            People

              Nguyen Nathan Nguyen
              brendanheywood Brendan Heywood
              Dmitrii Metelkin Dmitrii Metelkin
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                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