remotelearner / moodle-block_grade_me

14 stars 37 forks source link

Event observer queries are too slow on InnoDB with a large amount of rows #78

Open 1katoda opened 1 year ago

1katoda commented 1 year ago

As stated in the title, DELETE queries from the event observer take too long on InnoDB database with a large amount of records and cause manual quiz grading to timeout.

Moodle version: any (running 4.1.5 (Build: 20230814)) Plugin version: 2022112800

I'll submit a PR with fixes, where DELETE queries are run in chunks of 10000 (which improves loading time from ~300s / timeout to ~4s with 5825844 rows in block_grade_me_quiz_ngrade table)