title: Speeding ORDER BY clause with index
body: <p>I have a query with an <code>ORDER BY</code> clause that is slow due to the table having over 11 million rows.</p>
  
  <p>I can speed it up dramatically by adding a clustered index on the column in the <code>ORDER BY</code> clause. However, the software creates the query to order by different columns, depending on user settings. And you <a href="https://stackoverflow.com/questions/4618387/how-many-clustered-indexes-there-can-be-in-one-table/4618407">cannot add more than one clustered index to a table</a>.</p>
  
  <p>My question is: can non-clustered indexes be used to improve <code>ORDER BY</code> performance? Or is there something special about clustered indexes that means I will not be able to sort quickly for all columns?</p>
  
  <p><em>Note: I've posted my <a href="https://www.brentozar.com/pastetheplan/?id=Skjuu8sLX" rel="nofollow noreferrer">real query and execution plan online</a> but there are other issues that I don't want to go into here. I didn't create the database or write the query. And the query is still very slow even without the <code>IN</code> clause.</em></p>