-
Bug
-
Resolution: Fixed
-
Critical
-
2.6.5, 2.7.2
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
master_
MDL-47316 -
The patch to MDL-31089 causes a crazy number of sql queries to run if there are a large number of enrolled courses that contain forums with a large number of discussions. I saw one page (that eventually loaded) with over 60000 SQL queries used to build the page.
I think it's due to the use of:
$instances = get_fast_modinfo($discussion->course)->get_instances();
we have some users with over 200 course enrolments (mutliple clients use Moodle in this way) - so when they view the my moodle page it goes through each course, then obtains all discussions and does a get_fast_modinfo() on each causing a blow out to a crazy number of sql queries. usually this would be cached but as the modinfo is called sooo many times for each course (on every single discussion) it just can't cope.
Hopefully there is a more efficient method to check this.
- Insert a vast amount of data (see attached script)
- Login as a user with access to many courses which have many forum discussions from many users in a non-sequential manner
- View the /my page
- Click to view all courses
- Note DB read/writes
- Compare without this patch to ensure that performance is better with this patch
- has been marked as being related by
-
MDL-47895 Forum query for course overview block does crazy query which kills our testing server
- Closed
- is a regression caused by
-
MDL-31089 New posts listing on 'My Moodle' ignores groups.
- Closed
- is duplicated by
-
MDL-52026 block course overview has bad performance
- Closed