We are encountering a significant performance issue related to SQL Server compatibility during an upgrade of one of our applications. Below are the details of the problem:
Issue Summary:
While upgrading our application, the SQL Server compatibility level was updated from SQL Server 2016 (130) to SQL Server 2017 (140) (SSMS 2019 Version). We have observed a substantial increase in query execution time for a specific Cognos report dataset query.
Detailed Description:
Problem: A SQL query that previously executed within 10 minutes on SQL Server 2016 (130) now takes 5-7 hours to complete on SQL Server 2017 (140).
Observations:
Execution Plan Analysis:
SQL-2016: WaitTimeMs = 336, WaitCount = 175,051
SQL-2017: WaitTimeMs = 16,561, WaitCount = 6,357,099
Analysis: SQL-2016 shows significantly lower wait times and counts, indicating better memory management.
ASYNC_NETWORK_IO:
SQL-2016: WaitTimeMs = 4,255, WaitCount = 207
SQL-2017: WaitTimeMs = 4,283, WaitCount = 141
Analysis: Both sets are similar, but SQL-2016 is marginally better due to slightly lower wait times.
RESERVED_MEMORY_ALLOCATION_EXT:
SQL-2016: WaitTimeMs = 2,226, WaitCount = 1,018,040
SQL-2017: WaitTimeMs = 3,429, WaitCount = 1,353,109
Analysis: SQL-2016 shows better performance in memory reservation management.
PAGEIOLATCH_SH:
SQL-2016: WaitTimeMs = 388, WaitCount = 553
SQL-2017: WaitTimeMs = 836, WaitCount = 928
Analysis: SQL-2016 performs better for shared page I/O latches.
Additional Waits in SQL-2017:
LOGMGR_FLUSH: WaitTimeMs = 88, WaitCount = 219
PAGEIOLATCH_UP: WaitTimeMs = 4, WaitCount = 15
Impact: These waits are minimal and do not significantly affect overall performance in SQL-2017.
Thank you for your prompt attention to this matter.
Best regards,
Steps Taken So Far:
Increased both physical memory and cache size to address memory wait times.
Verified and compared execution plans between SQL Server 2016 and SQL Server 2017.
Despite these measures, we have not observed any improvement in the query execution time.
Request:
As this query is generated by Cognos and cannot be altered, we seek guidance on database settings or configurations that could optimize performance for this query on SQL Server 2017 (140) compatibility level. Your assistance in identifying and implementing a solution to ensure the query runs efficiently in the upgraded environment would be greatly appreciated.
Kamurukuri Vinod Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.