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

Improving performance of grade_item::regrade_final_grades

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 3.9.8, 3.10.5, 3.11.1
    • Gradebook

      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

       

            dmitriim Dmitrii Metelkin
            dmitriim Dmitrii Metelkin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.