Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.1
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      1. Look at a course page. Verify it still appears OK without error.
      2. Look at a forum view page. Verify it still appears OK without error.

      Optional extra section (if you can easily switch between branches)
      3. Turn on the 'perfdebug' option.
      4. Change to a branch without this patch.
      5. Load the course view page. Look at the database query counts. Reload a few times to get the minimum number. (It will depend on server settings and course content. On my test, that number was 60.)
      6. Change to a branch that includes this patch.
      7. Repeat #5. Verify that the number has now decreased by 2. (On my server, 58.)

      Show
      1. Look at a course page. Verify it still appears OK without error. 2. Look at a forum view page. Verify it still appears OK without error. Optional extra section (if you can easily switch between branches) 3. Turn on the 'perfdebug' option. 4. Change to a branch without this patch. 5. Load the course view page. Look at the database query counts. Reload a few times to get the minimum number. (It will depend on server settings and course content. On my test, that number was 60.) 6. Change to a branch that includes this patch. 7. Repeat #5. Verify that the number has now decreased by 2. (On my server, 58.)
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-39723-master

      Description

      The course format code makes an unnecessary get_record call on the course table for courses which are normally already loaded in memory: $COURSE and $SITE.

      Although this is only likely to be two queries per page, it is still worth saving two queries. Additionally, course table rows are quite large (typically in the 100KB range, with our largest being over a megabyte) so the queries may waste a bit of resources.

      It's only the course format that does this on every page. However, as this may be a more general issue, I suggest creating a get_course API to do it properly.

      I suggest this might be suitable for 2.5.1, or 2.6 if necessary. (At the OU we have already solved this problem because we use a custom database driver so we put the logic into there.)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    8/Jul/13