-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
2.2.6
-
None
-
MOODLE_22_STABLE
One of our sites is seeing long-running queries which take various forms like this:
UPDATE mdl_question_attempts SET maxmark = $X WHERE questionusageid IN (SELECT quiza.uniqueid FROM mdl_quiz_attempts quiza WHERE quiza.quiz = '$Y') AND slot = '$Z'
|
The subquery frequently returns an empty set, but MySQL will spend multiple minutes running this query as is examines the over 15M rows in this table when updates are not even necessary.
Please eliminate the need for a subquery here to improve performance of this query.
- duplicates
-
MDL-32616 Badly performing MySQL queries when editing questions
- Closed