-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
2
-
2
-
Problem Definition
The database migration executes the INSERT statements one at a time, which is inefficient due to multiple trips to the database. This causes a bottleneck on the migration because the database inserts cannot keep up with the processing of the changeset content.
The bottleneck is more apparent in SQL Server as the target database, with migrations taking 2.5x longer compared to Postgres.
Suggested Solution
Implement batch updates with Statement.executeBatch.
Sample implementation for SQL Server: https://learn.microsoft.com/en-us/sql/connect/jdbc/use-bulk-copy-api-batch-insert-operation?view=sql-server-ver15
Why This Is Important
By using batch updates, local tests reveal that it can reduce migration time by 85.37% for Postgres, and 94.29% for SQL Server.
Workaround
Currently, there is no known workaround for this behavior. A workaround will be added here when available
- is related to
-
BSERV-19757 The cwd_tombstone table is not getting cleaned up by Bitbucket
-
- Short Term Backlog
-
-
BSERV-12387 Speed up database migration
- Closed