What are you thoughts on restructuring this query?

Marty Bostick 2016-05-10 17:49:38

I am curious what optimization opportunities everyone would suggest around this query.

SQLkiwi 2016-05-11 04:45:11
I would be happy to make some detailed suggestions if you can provide a non-anonymized plan session, ideally captured directly from Plan Explorer, with the "Get Actual Plan" option selected. DDL for the tables and indexes involved would be a useful bonus. There's not a whole lot to be said on the basis of the anonymized, estimates-only plans provided. (You should also update your version of PE).
Aaron Bertrand 2016-05-11 12:46:12
Any chance you could post a non-anonymized version of the plan? Or update to the latest build of Plan Explorer and anonymize it again? Seems you have a rather old version of Plan Explorer, which wasn't always able to properly tokenize complex statements, so the query text simply becomes a word like "Statement1" – which is hard to make recommendations for.