-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance optimizations when bulk loading large amounts of timestamps #2194
Conversation
@microsoft-github-policy-service agree
Skickat från min iPhone
… 15 aug. 2023 kl. 22:33 skrev microsoft-github-policy-service[bot] ***@***.***>:
@microsoft-github-policy-service agree
|
Thank you for the PR @hannes92. We'll review it when we're able to and get back to you with our next steps. |
could you please add a test which covers the scenario |
Added a test case, I lowered the mount of rows inserted to 10000 to not slow down the test suite |
Hi @hannes92, The PR passes our internal testing, we'll now be reviewing it. |
src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTimestampTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTimestampTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTimestampTest.java
Outdated
Show resolved
Hide resolved
public class BulkCopyTimestampTest extends AbstractTest { | ||
|
||
public static final int COLUMN_COUNT = 16; | ||
public static final int ROW_COUNT = 10000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not really necessary to do this that many times, just make sure this is run at last once cover the newly added code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make changes as per comments
src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyAllTypesTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyAllTypesTest.java
Outdated
Show resolved
Hide resolved
After making the newly requested changes, LGTM. |
While writing software to sync a couple of hundred million rows from another rdbms to sql server via the BulkCopy API, I discovered a disproportioned amount of time was spent serializing Timestamp objects to then deserialize them into Timestamp objects once again.
My fix for this is to be able to accept Timestamp objects directly (which should cover the majority of objects passed) and only serialize them once when passing the date values to the TDSWriter.
I have attached an example to show the difference while importing about 600k rows with 16 columns with dates only.