Issue #3307558 by huzooka: Calculate migration dependencies before starting multi-thread migrations if there are lot of derivatives