-
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
Slowness in MS SQL Server JDBC driver #2432
Comments
We used to complete our data load of around 200 tables under 2 hrs with other driver and when we moved to SQL JDBC drivers , the load is not completing even after 7 hrs.
the sample we mentioned where there are 71 M records , it use to complete under 30 mins and not it takes around 6 -7 hrs
Thanks
Parag Pandit
Application Architect
***@***.******@***.***>
732.789.7326
[Logo Description automatically generated]<http://www.lumeris.com/> [Icon Description automatically generated] <https://www.linkedin.com/company/lumeris> [Logo Description automatically generated] <https://twitter.com/lumeris>
…________________________________
From: Jeff Wasty ***@***.***>
Sent: Friday, May 24, 2024 12:14 PM
To: microsoft/mssql-jdbc ***@***.***>
Cc: Parag Pandit ***@***.***>; Mention ***@***.***>
Subject: [External] Re: [microsoft/mssql-jdbc] Slowness in MS SQL Server JDBC driver (Issue #2432)
EXTERNAL
Client / Partner / Business Vendor
This email originated from a Lumeris affiliated entity. Please continue to exercise caution when opening links or attachments.
Note: If there is a security concern, please contact the Service Desk immediately<https://lumeris.service-now.com/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_category=e15706fc0a0a0aa7007fc21e1ab70c2f>.
Hi @paragpandit123<https://urldefense.com/v3/__https://github.com/paragpandit123__;!!IKIcsDr4!WsNtobhynlN7qZNvhllNrYLin7YsBqw13ORyIeRtItl4pfyIkMOiMpbuikV1QPgOLlpk2NsMR-Nkpd1dZTwYcEs$>,
The issue is that there is "slowness" in the driver, how slow? How long does it take to complete the above mentioned query? How much longer is this than what you expect?
When you say "slow", what is this in comparison to? Different queries? Or these same queries but tried with another version of the MSSQL-JDBC driver? Or are you comparing to another JDBC driver?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/microsoft/mssql-jdbc/issues/2432*issuecomment-2129920890__;Iw!!IKIcsDr4!WsNtobhynlN7qZNvhllNrYLin7YsBqw13ORyIeRtItl4pfyIkMOiMpbuikV1QPgOLlpk2NsMR-Nkpd1dYQdM5YI$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A7SAXHWPA75VFMTWGEMAICTZD5RQFAVCNFSM6AAAAABIHXCWCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZHEZDAOBZGA__;!!IKIcsDr4!WsNtobhynlN7qZNvhllNrYLin7YsBqw13ORyIeRtItl4pfyIkMOiMpbuikV1QPgOLlpk2NsMR-Nkpd1dwS0Hc64$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
This e-mail and any files accompanying this e-mail contain confidential information belonging to the sender. This information may contain protected health information and other material that is legally protected, privileged or proprietary. The information is intended only for the use of the individual or entity named above. The intended recipient of this e-mail is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to delete or destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately and delete this message.
|
Hi, Yes, sorry, I deleted my response as I realized this was a follow-up to a previous email issue that was sent to the team. Thank you for the additional information, we'll look into this and get back to you with our response. |
FYI, this is a production issue and needs a quick resolution.
Parag Pandit
Application Architect
***@***.******@***.***>
732.789.7326
[Logo Description automatically generated]<http://www.lumeris.com/> [Icon Description automatically generated] <https://www.linkedin.com/company/lumeris> [Logo Description automatically generated] <https://twitter.com/lumeris>
…________________________________
From: Jeff Wasty ***@***.***>
Sent: Friday, May 24, 2024 12:21 PM
To: microsoft/mssql-jdbc ***@***.***>
Cc: Parag Pandit ***@***.***>; Mention ***@***.***>
Subject: [External] Re: [microsoft/mssql-jdbc] Slowness in MS SQL Server JDBC driver (Issue #2432)
EXTERNAL
Client / Partner / Business Vendor
This email originated from a Lumeris affiliated entity. Please continue to exercise caution when opening links or attachments.
Note: If there is a security concern, please contact the Service Desk immediately<https://lumeris.service-now.com/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_category=e15706fc0a0a0aa7007fc21e1ab70c2f>.
Hi,
Yes, sorry, I deleted my response as I realized this was a follow-up to a previous email issue that was sent to the team. Thank you for the additional information, we'll look into this and get back to you with our response.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/microsoft/mssql-jdbc/issues/2432*issuecomment-2129935362__;Iw!!IKIcsDr4!WA83AhyiPMhS8t_uAdgyKHsQ0BjIRQRtH43l0yR4WhSyU6Dud2A4Y098AlRzH_InKBiX5TjdGQwoBIntKv7yuUA$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A7SAXHVZFBNH6VS5U63UOL3ZD5SJDAVCNFSM6AAAAABIHXCWCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZHEZTKMZWGI__;!!IKIcsDr4!WA83AhyiPMhS8t_uAdgyKHsQ0BjIRQRtH43l0yR4WhSyU6Dud2A4Y098AlRzH_InKBiX5TjdGQwoBIntFosUmnw$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
This e-mail and any files accompanying this e-mail contain confidential information belonging to the sender. This information may contain protected health information and other material that is legally protected, privileged or proprietary. The information is intended only for the use of the individual or entity named above. The intended recipient of this e-mail is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to delete or destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately and delete this message.
|
I read the email thread again. You are using the same connection string options and the same machines and servers in both cases, correct? You mention you are already using
Also please enable logging (https://learn.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver16) and allow logging to run for a set amount of time while waiting on the query. The timestamps will allow us to find out exactly what part of the driver is causing the long times. |
I have attached an image with connection details. I guess we need a call / working session.
Which will avoid back and forth .
How about sometime Monday , I am on east coast
Thanks
Parag Pandit
Application Architect
***@***.******@***.***>
732.789.7326
[Logo Description automatically generated]<http://www.lumeris.com/> [Icon Description automatically generated] <https://www.linkedin.com/company/lumeris> [Logo Description automatically generated] <https://twitter.com/lumeris>
[cid:64ca1470-9719-415e-a462-b11450997b2f]
…________________________________
From: Jeff Wasty ***@***.***>
Sent: Friday, May 24, 2024 3:28 PM
To: microsoft/mssql-jdbc ***@***.***>
Cc: Parag Pandit ***@***.***>; Mention ***@***.***>
Subject: [External] Re: [microsoft/mssql-jdbc] Slowness in MS SQL Server JDBC driver (Issue #2432)
EXTERNAL
Client / Partner / Business Vendor
This email originated from a Lumeris affiliated entity. Please continue to exercise caution when opening links or attachments.
Note: If there is a security concern, please contact the Service Desk immediately<https://lumeris.service-now.com/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_category=e15706fc0a0a0aa7007fc21e1ab70c2f>.
I read the email thread again. You are using the same connection string options and the same machines and servers in both cases, correct? You mention you are already using prepareMethod=prepare, there were 2 more questions:
* What are the encryption settings you are using (it would be best if you could share the connection string)? As mentioned in the email, even with identical settings JDBC and jTDS can have different performance based on how they handle encryption.
* Is Unicode data being used? If not, then try setting sendStringParametersAsUnicode=false
Also please enable logging (https://learn.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver16<https://urldefense.com/v3/__https://learn.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver16__;!!IKIcsDr4!X1PcvwDW6vnR1ruL6JWmXScTfDYpTzGQyZJfNqsEwbxrLYUcfE_Qsak1aQSdsEM2BwJCREqdojMmknRLxaLr5XI$>) and allow logging to run for a set amount of time while waiting on the query. The timestamps will allow us to find out exactly what part of the driver is causing the long times.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/microsoft/mssql-jdbc/issues/2432*issuecomment-2130230756__;Iw!!IKIcsDr4!X1PcvwDW6vnR1ruL6JWmXScTfDYpTzGQyZJfNqsEwbxrLYUcfE_Qsak1aQSdsEM2BwJCREqdojMmknRLN5nJCS8$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A7SAXHSM3TXZYP4XPZO74ALZD6IGJAVCNFSM6AAAAABIHXCWCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZQGIZTANZVGY__;!!IKIcsDr4!X1PcvwDW6vnR1ruL6JWmXScTfDYpTzGQyZJfNqsEwbxrLYUcfE_Qsak1aQSdsEM2BwJCREqdojMmknRLGd0Vyn0$>.
You are receiving this because you were mentioned.
This e-mail and any files accompanying this e-mail contain confidential information belonging to the sender. This information may contain protected health information and other material that is legally protected, privileged or proprietary. The information is intended only for the use of the individual or entity named above. The intended recipient of this e-mail is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to delete or destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately and delete this message.
|
I asked for additional connection settings because I was not sure whether the image was comprehensive. For instance, you have mentioned in the email you are already using Prior to any meeting, I would like to see where the slowness is happening in the driver. To do that, I will need to see the logs. Please capture the logs as described in the link above and either attach it to this issue or to the email thread. If a solution is not clear from the logs, then we can have a meeting to discuss this issue further. |
I will work with DBA's and try to get that log .
[cid:d9e5e708-4130-44dd-be01-cabfd109b6a0]
Parag Pandit
Application Architect
***@***.******@***.***>
732.789.7326
[Logo Description automatically generated]<http://www.lumeris.com/> [Icon Description automatically generated] <https://www.linkedin.com/company/lumeris> [Logo Description automatically generated] <https://twitter.com/lumeris>
…________________________________
From: Jeff Wasty ***@***.***>
Sent: Friday, May 24, 2024 3:49 PM
To: microsoft/mssql-jdbc ***@***.***>
Cc: Parag Pandit ***@***.***>; Mention ***@***.***>
Subject: [External] Re: [microsoft/mssql-jdbc] Slowness in MS SQL Server JDBC driver (Issue #2432)
EXTERNAL
Client / Partner / Business Vendor
This email originated from a Lumeris affiliated entity. Please continue to exercise caution when opening links or attachments.
Note: If there is a security concern, please contact the Service Desk immediately<https://lumeris.service-now.com/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_category=e15706fc0a0a0aa7007fc21e1ab70c2f>.
I asked for additional connection settings because I was not sure whether the image was comprehensive. For instance, you have mentioned in the email you are already using prepareMethod=prepare, but I do not see this as part of the connection options.
Prior to any meeting, I would like to see where the slowness is happening in the driver. To do that, I will need to see the logs. Please capture the logs as described in the link above and either attach it to this issue or to the email thread. If a solution is not clear from the logs, then we can have a meeting to discuss this issue further.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/microsoft/mssql-jdbc/issues/2432*issuecomment-2130255936__;Iw!!IKIcsDr4!Vlsa2qYrNr0wLgySdJ4L7Ws7WOnm8z2B_o9nNOn42qjH9idc2BywPGniYVkhR7EyPX_fl_1lKMnXUpfpjhrWdiE$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A7SAXHWNDTR3VEPQASAKHJTZD6KSZAVCNFSM6AAAAABIHXCWCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZQGI2TKOJTGY__;!!IKIcsDr4!Vlsa2qYrNr0wLgySdJ4L7Ws7WOnm8z2B_o9nNOn42qjH9idc2BywPGniYVkhR7EyPX_fl_1lKMnXUpfpjcDyJnI$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
This e-mail and any files accompanying this e-mail contain confidential information belonging to the sender. This information may contain protected health information and other material that is legally protected, privileged or proprietary. The information is intended only for the use of the individual or entity named above. The intended recipient of this e-mail is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to delete or destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately and delete this message.
|
This log should be enabled on SQL server right ? |
I guess we need to meet to understand the log request better. |
There is client-side logging for the JDBC driver. The JDBC driver uses standard Java logging that can be configured through your application or via a config in your Java home. See the link previously provided for details: https://learn.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver16 |
We are using Snaplogic tool to connect to SQL server. Not sure what can be done there. |
Contact Snaplogic support for assistance with logging in their application. |
We are working with snaplogic and will get back |
I'm not related to the project but here are my two cents...
what means "other driver" - older version of mssql-jdbc, other vendor (e.g. jTDS), ...? you also wrote that this is an production issue - does this mean that this issue does not exist in your development and integration-systems? 🤔 |
what means "other driver" - older version of mssql-jdbc, other vendor (e.g. jTDS), ...? JTDS This issue is there in all environment , the reason I mentioned production is just to get the urgency. |
Maybe you want to share your testcase and your measured times. |
Thats exactly , we wanted to meet , but we were told to wait till we get the logs. Thats what we are trying to get it with snaplogic environment we have. |
Hi @paragpandit123, I asked for the logs so that from the logs, we can see exactly what part of the driver is causing the slowness. To enable logging, you should follow the instructions in the provided link (https://learn.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver16). You commented you are using SnapLogic to connect to SQLServer. I have not used SnapLogic so I'm not sure how it interacts with our logging, so you either need to either (a) work with SnapLogic to produce JDBC logs using the above link, or (b) provide us with SnapLogic logging the shows us the same information. Once we have a clear idea of which part of the driver is causing the "slowness" we can work on resolving it. |
We are already working on getting those logs . |
sorry, that was probably a misunderstanding - with testcase I ment a unit-test or at least a code-snippet that everyone can run to analyze the performance difference. |
Hi @paragpandit123, Are you able to provide an update on the requested logs? |
We are getting close and will be able to send the logs soon.
Parag Pandit
Application Architect
***@***.***
732.789.7326
[Logo Description automatically generated]<http://www.lumeris.com/> [Icon Description automatically generated] <https://www.linkedin.com/company/lumeris> [Logo Description automatically generated] <https://twitter.com/lumeris>
…________________________________
From: Jeff Wasty ***@***.***>
Sent: Tuesday, June 11, 2024 5:36:35 PM
To: microsoft/mssql-jdbc ***@***.***>
Cc: Parag Pandit ***@***.***>; Mention ***@***.***>
Subject: [External] Re: [microsoft/mssql-jdbc] Slowness in MS SQL Server JDBC driver (Issue #2432)
EXTERNAL
Client / Partner / Business Vendor
This email originated from a Lumeris affiliated entity. Please continue to exercise caution when opening links or attachments.
Note: If there is a security concern, please contact the Service Desk immediately<https://lumeris.service-now.com/sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_category=e15706fc0a0a0aa7007fc21e1ab70c2f>.
Hi @paragpandit123<https://urldefense.com/v3/__https://github.com/paragpandit123__;!!IKIcsDr4!VHgPEbmXJY9gpA63Grogqpriax_aH8lXLqTDna3m6GnzE5S4qSS4ObEmVXzUUEdVBZ7rZLa6ScwZ8FwBDxR8kgg$>,
Are you able to provide an update on the requested logs?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/microsoft/mssql-jdbc/issues/2432*issuecomment-2161639134__;Iw!!IKIcsDr4!VHgPEbmXJY9gpA63Grogqpriax_aH8lXLqTDna3m6GnzE5S4qSS4ObEmVXzUUEdVBZ7rZLa6ScwZ8FwBDjCXBJk$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A7SAXHUI6SBPWZYTOZARKIDZG5UWHAVCNFSM6AAAAABIHXCWCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRRGYZTSMJTGQ__;!!IKIcsDr4!VHgPEbmXJY9gpA63Grogqpriax_aH8lXLqTDna3m6GnzE5S4qSS4ObEmVXzUUEdVBZ7rZLa6ScwZ8FwBTsJBYwU$>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
This e-mail and any files accompanying this e-mail contain confidential information belonging to the sender. This information may contain protected health information and other material that is legally protected, privileged or proprietary. The information is intended only for the use of the individual or entity named above. The intended recipient of this e-mail is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to delete or destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately and delete this message.
|
The logfile is huge , how do you wants us to send it ? |
You can email us the logfile - [email protected] |
Thank you for the logs, but we were not able to get any information from them. We're currently working with a repro that reproduces the issue described above. There have been some issues with running the repro and we're currently waiting on a reply from the author. |
I'm just curious but what does the executed query look like? join or condition sequence may influence performace. also don't forget that with many million rows it's possible that sequential scans are used instead of index scans. what do you do with snaplogic? |
The select statement is select <column_list> from table , no join or anything else. I have stated the same thing over and over to multiple people. Not sure how many times I have to explain that |
As mentioned before I'm not part of the project and only try to help based an on the informations in this issue... 🤔 some ideas:
that said, you can also try older versions of mssql-jdbc with "lesser" features. |
What this status means? What are you waiting for from me ? |
I've changed the status. As mentioned above, we're waiting on a repro from another party that should demonstrate this "slowness" issue, as we're unable to replicate the issue ourselves. |
i can show you the issue if we can get on call |
Hi @paragpandit123, After testing out the sample code, and talking with another user, I believe this issue may be due to the "flexible callable statements" feature introduced in 12.5.0. If possible, I would like you to test out two scenarios:
This is what I expect to happen:
Let us know if you're able to test the above, and what the results are. |
Thanks for the response, I will check both the options. |
I tried both the options
I did not see any improvement in the performance. |
I see, thanks. |
An update - we've identified what is causing the slowness, but do not have a fix ready at the moment. The work has been put into our backlog with high priority. Our goal is to have this fixed by the next GA, and we will provide updates here as work continues. |
Sounds good - can you describe what's slow so others can check whether they are affected or not? |
Thanks Jeffery , when is the next GA ? |
@AlBundy33 I'll update my comment. @paragpandit123 January 31, 2025 |
@Jeffery-Wasty Can you please give more information this issue? What is causing the issue? What are the symptoms of the error? We also using mssql-jdbc 11.2.0.jre and MSSQL 19 on Windows OS. We have cases in which queries are executed quickly and cases in which queries are executed very slowly. The DBAs couldn't find a reason on Database. It looks like there is a problem in the driver. |
Hi @thomasnikolay, The symptoms are slow performance when reading large amounts of data from a database (on the order of 1,000,000 rows with 500 columns). This performance was thought to be abnormally slow, as, when compared to jTDS, the JDBC driver takes 60 - 80% longer. It's still not clear what the cause of the issue is. We were provided with 2 instances of customers reporting this issue (which includes this GitHub issue), with each customer providing us with a repro. Using the repros we were able to reproduce the issue, though only on high performance machines (this is in line with what the customers were experiencing). However, an issue remains that while one of the customers was seeing this issue pop up with data sets with a large amount of NULL values only, we are seeing the performance issue regardless of the data issue. It's important that we're lined up on exactly how to reproduce this issue as if the issue is isolated only for large amounts of NULL values, that will greatly help us in nailing down the exact problem, and fix. Currently the above is where I'm at, trying to get an accurate repro. I can provide further updates as my work continues on the issue. Hope this helps clear up what exactly this issue is and how work is progressing on it! Regarding your issue - I would encourage the same check as I described above. Compare the performance on our driver vs. the same performance using the jTDS driver. If they are the same, this may be a different issue, and it would be recommended to open a new GitHub issue. If there is a significant difference, then please provide more information on what queries are being executed and how the tables involved look like (many nulls, no nulls, size, etc.). Thanks! |
JDBC VERSION: mssql-jdbc-12.6.1.jre11.jar
On Prem SQL Server Version : Query is getting data from databases on SQL 2017 and SQL 2019
How big is the query? I mean how many records it fetches and tables it query from SQL: In the sample we’ve used the return set is 71 million rows
The text was updated successfully, but these errors were encountered: