I have a very large query with three UNION ALL and it takes 30 minutes to execute.

Analyzing the execution plan I see that it has a high cost in SORT and Filter.

enter image description here

I tried to generate the showplan in XML but it's more than 2MB.

I put the complete query in OneDriver because it has 104364 characters

link to the query

Could someone help me to improve the execution time of the query?




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.