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

Speedup get_courses in lib/filebrowser/file_info_context_coursecat.php

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77439-401
    • MDL-77439-master
    • Hide

      Run the Unittests in lib/filebrowser/tests/file_browser_test.php

      In order to test the performance gain it is necessary to generate a large number of courses including a large amount of course modules.

      However, the optimization already shows when running the unit tests (lib/filebrowser/tests/file_browser_test.php). 
      current master: average 7.5s
      new master 4.1.1: average 5.2s

      Show
      Run the Unittests in lib/filebrowser/tests/file_browser_test.php In order to test the performance gain it is necessary to generate a large number of courses including a large amount of course modules. However, the optimization already shows when running the unit tests ( lib/filebrowser/tests/file_browser_test.php ).  current master: average 7.5s new master 4.1.1: average 5.2s

      During load testing on our very large instance, we noticed a slow query. This is caused by the query in get_courses in lib/filebrowser/file_info_context_coursecat.php. 

      On the one hand, the query was called very frequently and also took a comparatively long time.

      Environment:

      • MySQL;
      • course table: 400,000+ entries
      • context table: 16.5+ million entries

      Initial situation: Query runtime: 1,18s

      The main problems are the "or" and a case- and accentsensitive search, which is not necessary.

            MPe Peter Mayer
            MPe Peter Mayer
            PhMemmel PhMemmel
            Jun Pataleta Jun Pataleta
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 1 minute
                3h 1m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.