How can I tune this query
Based solely on the very limited information based on the original anonymized, pre-execution plans provided:
- Look to avoid Key and RID Lookups (where sensible) by providing covering indexes.
- Check lookup output columns and predicates to see which columns are missing.
- Avoid large scans, especially table scans on the inner side of a nested loop join.
- Consider alternatives to recursive CTEs.
Let me know if this is better.link text
Also it PE says: A query plan was not collected at the time of execution. Estimated plan generation is only available for non-dynamic root statements…
Is that because I ran a sp? Is there a way to generate the plan?