Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade on mysql get stuck on 2022090900 #770

Open
gbarat87 opened this issue Oct 9, 2024 · 2 comments
Open

Upgrade on mysql get stuck on 2022090900 #770

gbarat87 opened this issue Oct 9, 2024 · 2 comments

Comments

@gbarat87
Copy link

gbarat87 commented Oct 9, 2024

The upgrade step for the version 2022090900 takes forever on mysql with around 800000 rows in the table.

https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_401_STABLE/db/upgrade.php#L745

gbarat87 added a commit to gbarat87/moodle-mod_attendance that referenced this issue Oct 9, 2024
gbarat87 added a commit to gbarat87/moodle-mod_attendance that referenced this issue Oct 9, 2024
@golenkovm
Copy link

Hey @gbarat87 had a look at the patch. It's great you managed to resolve the issue by adding the index. However, it feels like we won't need that index on permanent basis. Also we need it for MySQL db family only. I'd suggest to simplify your patch, add the index before that SQL and drop the index after records are deleted.

@danmarsden
Copy link
Owner

feels like we're getting pretty hacky if we're adding indexes then removing them within the inline sql (and it's already pretty hacky having different sql for each db type.) - I think I'd prefer to just pull it out of the upgrade script and trigger an adhoc task to perform the clean up or force people to use a CLI script to do the work if they want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants