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

Improving performance of grade_item::regrade_final_grades

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 3.9.8, 3.10.5, 3.11.1
    • None
    • 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

              dmitriim Dmitrii Metelkin
              dmitriim Dmitrii Metelkin
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: