-
Notifications
You must be signed in to change notification settings - Fork 887
Closed
Description
When upgrading from Phinx v0.16.6 to v0.16.7 the time needed to run my migrations when running tests went from 12 seconds to 364 seconds. Specifically the one migration suffered by far the most, it went from 2 seconds to 354 seconds and it looks similar to this (slightly simplified):
final class NumbersInitialData extends AbstractMigration
{
private array $numbers = [
// about 150'000 numbers
];
public function up(): void
{
$table = $this->table('numbers');
// about 150'000 inserts
foreach ($this->numbers as $prefix => $length) {
$table->insert([
'prefix' => $prefix,
'count' => $length,
]);
}
// Save insert only at the end
$table->save();
}
}What this should do, as far as I know, is create those 150'000 inserts and then bulk-insert them with the $table->save(); at the end. Something changed significantly with Phinx v0.16.7 to slow down these kind of inserts. If I downgrade to Phinx v0.16.6 (and everything else stays the same) the speed goes back to 2 seconds. I checked the release notes for v0.16.7, but could not find any indication what could cause such a massive performance change.
Metadata
Metadata
Assignees
Labels
No labels