You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent a lot of time to work around problems of using useBulkCopyForBatchInsert=true (see #1784) with the latest driver 10.2.0 and finally got it to run (by replacing DATE/DATETIME with DATETIME2 column types and sendStringParametersAsUnicode=true). I duplicated our big table 1:1 and also our batch insert code to insert the very same date once with the standard batch inserts and a second time with these batch inserts and useBulkCopyForBatchInsert=true. The results are more than disappointing: if you have just a few rows, it's almost identical (sometimes the first version is faster, sometimes the second). But when you increase the amount of data to insert (multiple 100.000 rows), the bulk copy version is considerably SLOWER! ... about 5%, 10%, 15% slower! During the misc tests, increasing batch size doesn't help. I have no idea what's going wrong here ... this is a result of my tests for issue #1784.
The only difference between the 2 versions are, that the second version has different values for:
table DATE columns were excahnged to DATETIME2(0) - for bulk copy feature to work. And set the date values via setTimestamp() instead of setDate() to avoid error.
How is the bulk copy feature expected to improve such mass INSERTs?
(My tests checked the FINE log for "Falling back to the original implementation for Batch Insert " to ensure that bulk copy was used.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I spent a lot of time to work around problems of using useBulkCopyForBatchInsert=true (see #1784) with the latest driver 10.2.0 and finally got it to run (by replacing DATE/DATETIME with DATETIME2 column types and sendStringParametersAsUnicode=true). I duplicated our big table 1:1 and also our batch insert code to insert the very same date once with the standard batch inserts and a second time with these batch inserts and useBulkCopyForBatchInsert=true. The results are more than disappointing: if you have just a few rows, it's almost identical (sometimes the first version is faster, sometimes the second). But when you increase the amount of data to insert (multiple 100.000 rows), the bulk copy version is considerably SLOWER! ... about 5%, 10%, 15% slower! During the misc tests, increasing batch size doesn't help. I have no idea what's going wrong here ... this is a result of my tests for issue #1784.
The only difference between the 2 versions are, that the second version has different values for:
How is the bulk copy feature expected to improve such mass INSERTs?
(My tests checked the FINE log for "Falling back to the original implementation for Batch Insert " to ensure that bulk copy was used.)
Beta Was this translation helpful? Give feedback.
All reactions