Please help improve performance of this query

zygonr 2015-11-19 07:23:56

SQLkiwi 2015-11-30 11:48:32
The most obvious problem is that the instance of SQL Server is struggling for memory.

The evidence for this is the multiple memory-consuming operators that are spilling to disk to complete sorting and hashing operations. The root node of the plan (the green SELECT icon in this case) shows that SQL Server would have liked to allocate 781,992 KB memory for this query, but was only able to spare 101,968 KB.

You should increase the memory available to SQL Server, and/or tune the query and indexes such that fewer sorts and hashing operations are required.

zygonr 2015-12-01 12:17:07
Thank you I was able to tune the query by the query by adding indexes specifically non clustered index with included columns of my limited knowledge.