-
Bug
-
Resolution: Fixed
-
Critical
-
3.8.6, 3.9.3, 3.10
-
MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MDL-69687 tries to delete a lot of records on upgrade (well, on our database 20 503 086 rows out of 46 386 719) using the query
SELECT count(1) |
FROM mdl_course_modules_completion |
WHERE id IN ( |
SELECT cmc.id |
FROM mdl_course_modules_completion cmc |
LEFT JOIN mdl_course_modules cm ON cm.id = cmc.coursemoduleid |
WHERE cm.id IS NULL |
)
|
The essentialy runs forever (Well 48.5 minutes.)
That looks like it is eqivalent to
SELECT count(1) |
FROM mdl_course_modules_completion |
WHERE NOT EXISTS ( |
SELECT 1 |
FROM mdl_course_modules cm |
WHERE cm.id = mdl_course_modules_completion.coursemoduleid |
)
|
which run in 7 seconds on the same DB (though that is just a SLECET, it is not having to delete 20 million rows!)
I'll do a fix.
- is a regression caused by
-
MDL-69687 Improve removal of course module completion data
- Closed