MDL-43721 Assign + groups: Improve performance of assign grading table
commitc46db93c28cbaef276c1fad6bc5331784d850998
authorDamyon Wiese <damyon@moodle.com>
Wed, 26 Feb 2014 08:29:48 +0000 (26 16:29 +0800)
committerDamyon Wiese <damyon@moodle.com>
Thu, 6 Mar 2014 07:50:13 +0000 (6 15:50 +0800)
treed65213f7f158c5f399fd150447cec9cf63c4828e
parenta9e634afa6c070714dfdb9bda545207032cc56a2
MDL-43721 Assign + groups: Improve performance of assign grading table

Add a function to the groups lib to filter a list of users down
to the ones who can see the module. Required because calling
groups_course_module_visible() for a list of users is too slow
and we shouldn't spread group logic outside of grouplib.php.

Using it in the assign grading table reduces DB queries from 6198/1 to 256/3.

This is 12secs down to 2.5secs.
lib/grouplib.php
mod/assign/locallib.php