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

Speeding up course listings on large sites

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.5.2
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      Before test: Create several (the more the better) course categories

      Repeat on branch with the patch and without (revert the commit):

      1. Purge all caches (in another window)
      2. Open /course/manage.php, make sure everything is displayed correctly, copy page performance information
      3. Refresh the page, copy page performance information
      4. Purge all caches (in another window)
      5. Open one category, make sure the list to jump to another category is populated correctly, copy page performance information
      6. Refresh the page, copy page performance information
      7. Purge all caches
      8. Open admin settings page: /admin/settings.php?section=enrolsettingsdatabase, make sure categories list is populated correctly, copy page performance information
      9. Refresh the same settings page, copy page performance information

      Performance should be improved, especially the number of DB queries.
      Testing only on 2.5 is enough, this code was not modified in master and is completely the same.

      Show
      Before test: Create several (the more the better) course categories Repeat on branch with the patch and without (revert the commit): Purge all caches (in another window) Open /course/manage.php, make sure everything is displayed correctly, copy page performance information Refresh the page, copy page performance information Purge all caches (in another window) Open one category, make sure the list to jump to another category is populated correctly, copy page performance information Refresh the page, copy page performance information Purge all caches Open admin settings page: /admin/settings.php?section=enrolsettingsdatabase, make sure categories list is populated correctly, copy page performance information Refresh the same settings page, copy page performance information Performance should be improved, especially the number of DB queries. Testing only on 2.5 is enough, this code was not modified in master and is completely the same.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-MDL-41114-master

      Description

      During some performance testing of courses/coursecat listings I found several bugs that significantly decrease performance in case of large amount of course categories.

      • function coursecat::make_categories_list() does not use retrieved contexts and has to query them again.
      • /course/manage.php uses field coursecat::$coursecount that was not fetched when retrieving the course category children.
      • make_categories_options() unnecessary queries the course categories table again.

      Both fixes are one-line so I submit them in one issue.

        Attachments

          Activity

            People

            • Assignee:
              marina Marina Glancy
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Damyon Wiese
              Integrator:
              Sam Hemelryk
              Tester:
              Jason Fowler
              Participants:
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Sep/13