how can I reduce the cost of sorting prior to aggregate?

carl2016 2016-11-15 23:09:05

So the index1 in onject 2 is already expensive but I'm wondering what else can be done in this query?

Thanks

SQLkiwi 2016-11-16 03:38:19
The sort can be removed by providing a covering index keyed on Column1, Column3, Column2, Column4.

Columns 3, 2, and 4 appear to be in the index already as included columns. Moving them to be key columns should remove the need for the sort.