Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 3.8.6, 3.9.3, 3.10
-
Component/s: Activity completion, Performance
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
Fixed Branches:MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
Pull from Repository:
-
Pull 3.8 Branch:
MDL-70285_38 -
Pull 3.8 Diff URL:
-
Pull 3.9 Branch:
MDL-70285_39 -
Pull 3.9 Diff URL:
-
Pull 3.10 Branch:
MDL-70285_310 -
Pull 3.10 Diff URL:
-
Pull 3.11 Branch:
MDL-70285_311 -
Pull 3.11 Diff URL:
-
Pull Master Branch:
-
Pull Master Diff URL:
Description
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.
Attachments
Issue Links
- is a regression caused by
-
MDL-69687 Improve removal of course module completion data
-
- Closed
-