grade_grades_history and grade_items_history are ENORMOUS

grade_grades_history and grade_items_history are ENORMOUS

by Bob Puffer -
Number of replies: 2

Something in the way Moodle 2.x is storing grade histories stinks to high heaven.  Below is the stats from our two system, having gone live with 2.3.x in February of this year and 2.5.1+ in August.  The reason cited for removing grades from the grade tables when a user is unenrolled (causing no end of headaches) was to 'save space'.  This doesn't seem to be saving space but eating it alive.

 

  Moodle 1.9.x Moodle 2.3 - 2.51
terms  2 year + 1 term 2 terms plus summer sessions
number of courses 5,823 2,275
courses using gradebook 1,681 611
number of grade_grades records 667,070 278,870
grade_grades_history size 315MB 850MB
number of grade_items records 33,171 11,800
grade_items_history size 1.8MB 844MB

 

 

In reply to Bob Puffer

Re: grade_grades_history and grade_items_history are ENORMOUS

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Same here. I'm at grade_grades_history over one gigabyte. However grade_items_history size is only 49 mb.

In reply to Richard van Iwaarden

Re: grade_grades_history and grade_items_history are ENORMOUS

by Bob Puffer -

In a separate forum on the CME (CLAMP Moodle Exchange) I was guided to the fact that some versions of 2.3 sent massive numbers of records to these tables. I have removed them by:

  1. querying the table for count of records that have the same timestamp
  2. looking at the highest numbers and comparing the timestamp
  3. removing all records that fall within a certain timestamp range