Repository navigation
Addressed performance issue on Bulk Copy API with batch insert - #2735
Merged
Mahendra Chavan (machavan) merged 5 commits intoAug 14, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Ananya Garg (Ananya2)
previously approved these changes
Aug 12, 2025
Divang Sharma (divang)
previously approved these changes
Aug 12, 2025
Divang Sharma (divang)
approved these changes
Aug 13, 2025
David Engel (David-Engel)
approved these changes
Aug 13, 2025
Ananya Garg (Ananya2)
approved these changes
Aug 14, 2025
Mahendra Chavan (machavan)
approved these changes
Aug 14, 2025
David Engel (David-Engel)
deleted the
users/muskgupta/bulkcopyapi_perf
branch
October 10, 2025 14:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A GitHub issue was raised highlighting a performance degradation in the Bulk Copy API when using batch inserts
Pre-release 13.1 is slower #2732
The original issue reported was Bulk copy for batch insert destroys data without error #2669
This occurred when inserting string data using the following settings:
Under these conditions, data was inserted in byte array format rather than as readable strings.
Expected behavior
Select StateCode from states -> "OH"
Actual behavior
Select StateCode from states; -> "[B@4b01d9e4"
On top of this a new issue was reported Accented characters saved incorrectly in database when using useBulkCopyForBatchInsert=true and sendStringParametersAsUnicode=false #2721.
When inserting data using useBulkCopyForBatchInsert=true and sendStringParametersAsUnicode=false, names with accented characters were saved incorrectly in the database.
Root Cause
When inserting string data using batch insert for bulk copy with below combinations:
Fix#2704 and Fix#2727 introduced a performance slowdown because of unnecessary conversion from byte array back to string during the bulk copy batch insert operation.
Fix
Modified the logic to avoid sending data as a byte array in the first place when useBulkCopyForBatchInsert=true. As data inserted to destination table is being taken from dtv.value which is byte array.
Post this fix performance has improved significantly.
Testing