Query Performance Tuning: ORDER BY from 20s to 119ms in Microsoft SQL Server
Last week we noticed that in some of our production environments, a request was performing very bad times, more than 20 seconds to complete. After analyzing the case we could reduce this to 119 milliseconds. I would like to share the steps we made to reach this: