• just to let you know the tempdbs didn't sort it, the restart sorted it temporarily but then the issue returned. Eventually tracked it down to trace flag T8780 being turned on. This trace flag increases the timeime the optimiser can search for the best plan before a timeout occurs. Because the query was so complex this was taking 10minutes and STILL timing out.

    I turned the trace flag off and the query now runs in seconds, all be it with a sub optimal plan.

    Just need to figure out what is turning the trace flag on.