gitlab-org--gitlab-foss/spec/lib/gitlab/database
Yorick Peterse 0054d3838c
Reduce UPDATEs for background column type changes
Prior to this commit we would essentially update all rows in a table,
even those where the source column (e.g. `issues.closed_at`) was NULL.
This in turn could lead to statement timeouts when using the default
batch size of 10 000 rows per job.

To work around this we don't schedule jobs for rows where the source
value is NULL. We also don't update rows where the source column is NULL
(as an extra precaution) or the target column already has a non-NULL
value. Using this approach it should be possible to update 10 000 rows
in the "issues" table in about 7.5 - 8 seconds.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/42158
2018-01-18 14:22:41 +01:00
..
rename_reserved_paths_migration
grant_spec.rb
migration_helpers_spec.rb Reduce UPDATEs for background column type changes 2018-01-18 14:22:41 +01:00
multi_threaded_migration_spec.rb
sha_attribute_spec.rb