Put an upper limit on update batches
This puts an upper limit of 1000 on the batch size of update_column_in_batches
. This should reduce the time spent per UPDATE, which in turn will reduce the time data is locked. This in turn will reduce the likelihood of running into deadlocks.