We have a table with two nonclustered indexs. The two indexes both have the same three columns, in the same order they only differ in that one is sorted ascending the other descending. A developer had created a stored procedure that does a select where he intended to (but forgot!) to force the use of an index rather than do an Order by. When one user runs the query one index is consistently selected (ironically the correct one which masked this error for some time), when another user runs the procedure the other index is returned. What would be different between two users running the exact same procedure that would influence index selection?
(Note: this code will be rewritten, but I am trying to come to an understnading of what went on here for an After Action Report).
Thanks in Advance