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

Speedup get_courses in lib/filebrowser/file_info_context_coursecat.php

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          People

            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

            Dates

              Created:
              Updated:
              Resolved:
              12/Jun/23

              Time Tracking

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