Help with removing the sort form the plan

Hi,

Im trying to remove the sort from the execution plan. Unfortunately i cannot change the schema but i can change the indexing. I can provide existing indexes if required, otherwise im happy to put a brand new index on if it will solve this issue (reporting database)

Thanks

EDIT *** New plan attached with cut down versions of the tables and create scripts including data. Ive added the index definitions that the plan is using. If there is anything else that would help please let me know and i will do my best to provide it (gov department and they get concerned with posting too much information) link text

avatar image By Matak 14 asked Apr 08, 2016 at 12:14 AM
more ▼
(comments are locked)
10|10000 characters needed characters left

1 answer: sort voted first

It's always harder to work from an anonymized plan, but:

Index4 needs Column4 in the key after Column3. At the moment it seems Column4 is an included column, or perhaps further down the key list.

 Index4 -> (Column3, Column4) include (Column5);

If that doesn't remove the sort, provide a non-anonymized plan. Table and index DDL would save some time too.

avatar image By SQLkiwi ♦ 6.6k answered Apr 08, 2016 at 01:06 AM
more ▼
(comments are locked)
10|10000 characters needed characters left
Your answer
toggle preview:

Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.

Follow this question

Topics:

x641
x455
x117
x44
x27

asked: Apr 08, 2016 at 12:14 AM

Seen: 60 times

Last Updated: Apr 08, 2016 at 03:17 AM