Need help to troubleshoot query performance issue in SQL 2014(120) which works fine in SQL 2008 R2(100).
In my scenario a db was restored from a system(S-OLD) with SQL 2008 R2 to another system(S-NEW) with SQL 2014(12.0.02342) and the compatibility level changed to 120(For SQL Server 2014) on S-NEW. Post migration steps taken are DBCC CHECKDB, UpdateUsage, Index Rebuild and Stats Update in that order.
Now the application pointing to S-NEW is running extremely slow. But on S-NEW when the compatibility level was changed to 100 the application runs fast.
Comparing the Execution Plan of 100 vs 120 both on S-NEW shows that the nodes are all same with difference in cost of two nodes Index Seek and Index Lookup.
On 100 - Index Seek(1%) and Index Lookup(1%)
On 120 - Index Seek(25.3%) and Index Lookup(25.3%)
Notice that in 120 compatibility level the cost has gone considerably high. Query running on 120 took several hours(15hrs) compared to old time of less than 2min. Based on the DMV output the CPU usage is keeps increasing when in 120.
Roughly the query contains a join and around 20-25 Exists clause. Changing the Exists to Join also did not help.
Has anyone faced this issue and managed to solve or can provide pointers?