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

Global search slow when search within all courses user can access

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.9.6, 3.10.3, 3.11
    • Global search
    • None
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE

      Query creation in Global search is slow when user have access to large number of courses. Users with Manager role usually have access to large number of courses.

      This issue is with creation of the query rather than execution. Therefore, it affects both search engines (simple & solr)

      It does not hugely impact site administrators because it function get_areas_user_accesses returns early for them or filter is applied.

      lib\accesslib.php uses static variables for caching. get_child_contexts() finds all child contexts for each course_context, add them into static cache.

      In large sites, for users who have access to 5000+ courses, it retrieves all their child contexts every time when using global search, making global search take 30+ seconds.

      I propose to add a new application cache area for child_contexts. It will be used to store child_contexts for a given context.

      We can populate static cache from application_cache instead of querying database for backwards compatibility.

            Unassigned Unassigned
            montypanday Monty Panday
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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