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

reduce database queries made by print_whole_category_list()

    Details

    • Testing Instructions:
      Hide

      Test functionality:

      • Requires a site with several categories and courses
      1. Note down the category structure and which courses are in each category before the patch.
      2. Add course categories, courses, and combo list to your front page.
      3. Update the site with the patch.
      4. Check that everything is in the exact same place it was before.

      Test performance.

      • Create 100+ course categories, several levels deep.
      • Generate courses for each (if you are able to)
      • Set maxcategorydepth = Unlimited
      • Set the front page setting to show course categories, courses and combo list on the front page.
      • Compare database query count with and without this patch

      Regarding data generation if you don't have a large database already you may want to script the generation. You can make use of the PHPUnit data generator if you want.

      Show
      Test functionality: Requires a site with several categories and courses Note down the category structure and which courses are in each category before the patch. Add course categories, courses, and combo list to your front page. Update the site with the patch. Check that everything is in the exact same place it was before. Test performance. Create 100+ course categories, several levels deep. Generate courses for each (if you are able to) Set maxcategorydepth = Unlimited Set the front page setting to show course categories, courses and combo list on the front page. Compare database query count with and without this patch Regarding data generation if you don't have a large database already you may want to script the generation. You can make use of the PHPUnit data generator if you want.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-MDL-36035-m25

      Description

      Currently, print_whole_category_list can use one database query per category that is displayed (it calls get_courses()).

      https://github.com/brki/moodle/tree/mdl23-reduce-db-queries-for-print_whole_category_list provides a solution that significantly reduces database queries for sites that have a large number of course categories.

      On a Moodle with 1252 course categories and maxcategorydepth = Unlimited, this reduces the database reads from 1313 to 62 for course/index.php.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13