-
Improvement
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
1.9.13, 2.0.4, 2.1.1, 2.2
-
MySQL 5.1 on Ubuntu 10.04
-
MySQL
-
MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
The function get_user_access_sitewide() in access.php uses a very expensive DB query with a three-level JOIN. It was optimized in MDL-15748 by adding the following additional condition in the WHERE clause:
ctx.contextlevel <= 40
Even with this improvement, it runs very slowly on systems with a large number of user-level role assignments (Mentor role). My suggestion is to optimize the query further by changing the above condition to:
ctx.contextlevel = 10 OR ctx.contextlevel = 40
For details, see http://moodle.org/mod/forum/discuss.php?d=184624 .
- will be (partly) resolved by
-
MDL-49398 Role definition caching & accesslib refactoring
-
- Closed
-