Migration for removing duplicate notification settings takes a very long time to run
20160603180330_remove_duplicated_notification_settings.rb is supposed to remove duplicate notification settings. When using a database with a lot of rows in
notification_settings (467849 in my case) this can take a very long time to run. I had to abort the migration after 45 minutes (of it taking up an entire CPU core).
On GitLab.com (or any other installation with more rows) this migration may end up taking several hours. We should try to improve this migration so it can finish in lets say up to 30 minutes.
The query for getting the grouped notification rows took around a second to run locally so it seems the actual
DELETE is the problem. Perhaps deleting rows in batches may speed things up.