Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.6.2
-
Testing Instructions:
- Upgrade your site and verify that there are no errors.
- Try to view the plugin overview page, and verify there are no errors.
-
Affected Branches:MOODLE_26_STABLE
-
Fixed Branches:MOODLE_26_STABLE, MOODLE_27_STABLE
-
Pull from Repository:
-
Pull Master Branch:
-
Pull Master Diff URL:
Description
When loading the plug-in overview page, I am seeing queries like:
SELECT 'x' FROM mdl_question_attempts WHERE behaviour = 'missing' LIMIT 0, 1
|
It looks like it runs for every possible behaviour. When the question_attempts table is large, this can take a long time, causing extremely long load times on the plug-in overview page.Why do these queries run when you load that page and can we put an index on that field?
explain SELECT 'x' FROM mdl_question_attempts WHERE behaviour = 'missing' LIMIT 0, 1;
|
+------+-------------+-----------------------+------+---------------+------+---------+------+---------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-----------------------+------+---------------+------+---------+------+---------+-------------+
|
| 1 | SIMPLE | mdl_question_attempts | ALL | NULL | NULL | NULL | NULL | 3317019 | Using where |
|
+------+-------------+-----------------------+------+---------------+------+---------+------+---------+-------------+
|
|
SELECT 'x' FROM mdl_question_attempts WHERE behaviour = 'manualgraded' limit 0, 1;
|
|
Empty set (1 min 29.28 sec)
|
Attachments
Issue Links
- caused a regression
-
MDL-46832 Ugrade to Moodle 2.7.1+ ends up with a database error (MS SQL)
-
- Closed
-