Fixed #23745 -- Improved migrate speed

Of course, commit c7ea633 will not be eventually included, it only serves to measure performance.
This line and the line above can be simplified to `return found_create_migration, after_state`