Is there performance issue with roles?

Re: Is there performance issue with roles?

by Markus Hagman -
Number of replies: 0
Hmm I tried to add different settings to our mylsq-server with no success on this matter

at the end of this message are all the variables from mysql.

**QUOTE***
All the calculations for yourself are done just once when you log in and then cached, and there is further caching at about three levels going on when you make calls to check permissions for other users.
***QUOTE***

Yep my own profile isnt the problem, must checkin other users profiles. This causes extensive load on mysql.

This is the part which causes the load in function get_my_courses:

if ( has_capability('moodle/course:view', $context, $userid, false) &&
!has_capability('moodle/legacy:guest', $context, $userid, false) &&
($course->visible || has_capability('moodle/course:viewhiddencourses', $context, $userid))) {
$mycourses[$course->id] = $course;


We have 400+ courses so I takes a while going through every course in a loop (using get_my_courses-function).