-
Bug
-
Resolution: Fixed
-
Minor
-
3.4.4, 3.5.1, 3.6.2, 3.7
-
MySQL
-
MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
When trying to use 'Server files' in the file picker repository list at a site context it can take an extremely long time to complete on a site with a large number of activities and files.
The server files loaded for us at the site level in Moodle 3.2 at a reasonable speed
For example on our site it takes over an hour for the request to complete when trying to look at the site level folder.
It appears that the query in file_info_context_course::get_module_areas_with_files() is the cause.
The explaine for the query is:
id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | ctx | ref | PRIMARY,mdl_cont_conins_uix,mdl_cont_pat_ix | mdl_cont_conins_uix | 8 | const | 1611769 | Using where; Using temporary; Using filesort |
1 | SIMPLE | f | ref | mdl_file_con2_ix | mdl_file_con2_ix | 8 | moodlerc_17May2018.ctx.id | 3 | Using where |
- Individually the query takes around 4 seconds to run
- at the site level it is run nearly 400 times
- is a regression caused by
-
MDL-35668 Server files repository takes a long time to load
- Closed