>I would start from trying to discover which JOIN takes the most time by eliminating JOINs one by one. Recently I had a similar situation (although the query was much more complex). I removed LEFT JOIN and made a temporary table of the rest and then LEFT JOINed with that temp table instead. The query that took originally more than 1 minute, now takes less than a second. The client called that procedure "lightingly fast".
>
>And after that experience I figured out that it's always a good idea to improve the performance gradually to get these comments :)
It is not related to INNER JOINs. I have simplified it to this point:
SELECT Task.Numero AS LXPrimaryKey,Task.Title,'' AS PrecisedTime,Task.Instance,Task.Class,Task.Method,
'' AS Log2,Task.LoopDateStart,Task.LoopDateEnd,Task.AddDate,Task.ModDate,Task.Precised,Task.Log
FROM Task (NOLOCK)
ORDER BY Task.Title
And, this takes over 1 second to return the maximum number of recordsin that table, which is 43.
Based on the transport level connection error we got on that one, I suspect data corruption. I will try to simplify more and will provide feedback after.