Where do I begin?
This is a slow running report sp. It takes about 30 mins even after implementing every missing index (NB: all these databases are overwritten every night – so adding indexes here on 'reporting' is not permanent – just saying).
I post this partly to learn performance tuning.
Step-2 (after looking at indexes) would be …looking at scans? lookups? spools? sorts? the big picture? its blinding.