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

Missing index on (timemodified) in grade_items_history table and several other grade history tables

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Validate timemodified is added as an index (not unique) on the following tables grade_outcomes_history, grade_categories_history, grade_items_history, and scale_history (e.g. show index from mdl_scale_history etc).
      Show
      Validate timemodified is added as an index (not unique) on the following tables grade_outcomes_history , grade_categories_history , grade_items_history , and scale_history (e.g. show index from mdl_scale_history etc).
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      wip-MDL-55652-master

      Description

      I have noticed on larger sites that this query can take a long time:

      DELETE FROM mdl_grade_items_history WHERE timemodified < ?

      Would it be possible to get an index added to the grade_items_history table for timemodified?

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17