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

Improving performance of grade_item::regrade_final_grades

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.9.8, 3.10.5, 3.11.1
    • Fix Version/s: None
    • Component/s: Gradebook

      Description

      On the big sites grade_item::regrade_final_grades can be run up to 1000 times per second during the busy exams period . 

      After doing a quick analysis our inf team end up with SQL that can be improved.  This SQl at some point creates  duplicate dead tuple rows.

      UPDATE mdl_grade_grades
      SET aggregationstatus = 'used',
      aggregationweight = $1
      WHERE itemid = $2 AND userid = $3

      This SQL is coming from grade_category::set_usedinaggregation

      The below sql would stop postgresql creating duplicate dead tuple rows and the associated index update / wall logs if anything was slipping through.

      UPDATE mdl_grade_grades
      SET aggregationstatus = 'used',
      aggregationweight = $1
      WHERE itemid = $2 AND userid = $3 and aggregationstatus != 'used' and aggregationweight != $1

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dmitriim Dmitrii Metelkin
              Reporter:
              dmitriim Dmitrii Metelkin
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: