-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.9.6, 3.10.3, 3.11
-
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.
- duplicates
-
MDL-63731 Global Search very slow or runs out of memory if a user has access to a lot of courses
- Open