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

function assign_files should not have to make db calls to get course/coursemodule

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.11, 3.11.2
    • 4.0
    • Assignment
    • MOODLE_311_STABLE
    • MOODLE_400_STABLE
    • Hide
      Before the patch
      1. Check out a version before this patch (e.g. "git checkout dc437b51715")
      2. Go to admin > development > debugging and turn perfdebug on. Or if using MDK: "mdk run mindev"
      3. Create a test course that includes at least 10 participants
      4. Create an assignment with "File submissions" enabled in the "Submission types" section
      5. Enter the assignment and hit the "View all submissions" link to view the grading page.
      6. Use the "edit" -> "edit submission" link on a number of students and add a file to their submission - (5 students is probably enough for testing, but the larger the number of students the bigger difference in sql reads that will occur.)
      7. Reload the assignment grading page about two times. Take note of the "DB reads" value at the bottom of the page.
      Apply the patch
      1. Check out the version with this patch applied.
      2. Reload the assignment grading page a couple of times. Take note of the DB reads value at the bottom of the page.
      3. Confirm that they are lower than the number before the patch.
      Show
      Before the patch Check out a version before this patch (e.g. " git checkout dc437b51715 ") Go to admin > development > debugging and turn perfdebug on. Or if using MDK: " mdk run mindev " Create a test course that includes at least 10 participants Create an assignment with "File submissions" enabled in the "Submission types" section Enter the assignment and hit the "View all submissions" link to view the grading page. Use the "edit" -> "edit submission" link on a number of students and add a file to their submission - (5 students is probably enough for testing, but the larger the number of students the bigger difference in sql reads that will occur.) Reload the assignment grading page about two times. Take note of the "DB reads" value at the bottom of the page. Apply the patch Check out the version with this patch applied. Reload the assignment grading page a couple of times. Take note of the DB reads value at the bottom of the page. Confirm that they are lower than the number before the patch.

    Description

      function assign_files is called multiple times on a single page - and doesn't get the full course or coursemodule records so has to make db requests based on $context to obtain these, slowing down the page access.

      Attachments

        Issue Links

          Activity

            People

              danmarsden Dan Marsden
              danmarsden Dan Marsden
              Sujith Haridasan Sujith Haridasan
              Jun Pataleta Jun Pataleta
              Gladys Basiana Gladys Basiana
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                19/Apr/22

                Time Tracking

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