How can I improve this plan. Table Insert is costing the most at 84.6% – can it be improved ?

Pearljammer1 2017-05-05 08:32:53

Aaron Bertrand 2017-05-05 12:56:23
Well, an insert costs what it costs. You can sometimes reduce the cost by doing things like eliminating indexes, but it doesn't seem like that's an issue here. It would be great to see an actual plan generated from within Plan Explorer so we can see things like duration. My guess is that while that has a seemingly high I/O cost, the relative cost % is not a meaningful metric.
Pearljammer1 2017-05-05 13:51:05
Hi Aaron,

I have re run the query from with PE like you said. I didn't even know you could do this – so much more info available. I have attached the plan as requested….

link text

Aaron Bertrand 2017-05-05 20:35:47
Seems to me that most of the work is spent doing all those clustered index scans, which contribute to a high number, not the insert itself. Have you considered indexing a persisted computed column like UnsafeConditionsObserved + SuggestedSolution, and then a filtered index against computedcolumn > "? Just one example that might avoid scanning PC_Core_UnsafeConditionsObserved (the benefit will depend on how many rows have a value in either of those columns).