Patch your SQL Server 2012 instance from SP1 up to SP3.
You will then be able to use trace flag 7470, which will most likely address this. See:
FIX: Sort operator spills to tempdb in SQL Server 2012 or SQL Server 2014 when estimated number of rows and row size are correct
Thanks Paul, This query is a stripped down 'summary' of the 'details' report. I guess the core issue is that its just too slow - and the spill is a consequence of that. Any thing jump out at you about my too-slow code? Richard
Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.
Answers and Comments
query plan x683
plan explorer upload x494
execution plan x125
poor performance x116
asked: Apr 13, 2017 at 09:47 AM
Seen: 88 times
Last Updated: Apr 18, 2017 at 09:33 AM
Any ideas to increase performance of this query?
Same Query, Two Plans, One Stinks
How can I improve this plan. Table Insert is costing the most at 84.6% - can it be improved ?
Component running slow
Is there a better way to search for matches
Execution plan mystery
Any idea why the filter limiting to 5K instead of 320K rows is done at the end ?
A filter with the attached query causing slowness and performance issues
Trying to understand why partition elimination is happening in some plans, but not others
© 2013 SQL Sentry, Inc. All rights reserved.