SQLTeam.com | Weblogs | Forums

Timeout when executing MERGE-statement in SQL Server 2016


#1

After migrating from SQL Server 2014 to SQL Server 2016, we have been experiencing query timeouts using MERGE-statements on some datasets.

Tested versions:
WORKING: SQL Server 2014 Enterprise (64-bit) (12.0.5532.0)
TIMEOUTS: SQL Server 2016 Enterprise (64-bit) (13.0.4001.0) and SQL Server 2016 Enterprise (64-bit) (13.0.1601.5)

Code to reproduce the timeout error: http://pastebin.com/DXZJzyJv


#2

Could this be your problem be?

ON (target.[HashedBK] = source.[HashedBK] and target.[Bit] = 1)

You have no Index on this key column , HashedBK, you are joining on, or am I missing something?