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

Optimization to rebuild_course_cache() (a small patch included)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.9
    • Component/s: Course
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The included path made my test boxes (both Windows and Linux) to run rebuild_course_cache() 50% faster. I tested with a large Moodle site (tens of thousands of resources), and in those cases upgrading from 1.6.3 to 1.7 called rebuild_course_cache() for all courses.

      The patch does the following

      1) in get_array_of_activities() only the columns "section, sequence" are required from the sections table
      2) resource_get_coursemodule_info() read all of the resource data. The "alltext" column can be quite large. Only the columns "id, name, type, reference, popup" are required. The resource "name" is stored to the info field also.
      3) get_array_of_activities() had one query for resource/activity name only. Now, if it's already read in step 2), then it is read from the $info, otherwise it's read as before. This generates one less query per resource.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              samulik Samuli Karevaara
              Tester:
              Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08