Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.4.5, 3.5.2, 3.6
-
Fix Version/s: 3.7
-
Component/s: Enrolments, Libraries
-
Testing Instructions:
-
Affected Branches:MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
Fixed Branches:MOODLE_37_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-63938-master -
Pull Master Diff URL:
Description
Some of the queires in course_enrolment_manager can be extemely slow. E.g. as reported at MDL-56059, get_potential_users can do a count_records that takes 7 seconds followed by a get_records that does 5 seconds (and then the count is not displayed in the Enrol users pop-up). This is a horrible waste.
The API needs to be changed so that the count_records is only done if really needed.
(If count_records is not done, then we could increase $limitnum by 1, and check if the last row is included, to know if there is more data, and return that instead of an exact count.)