SQL Server Optimization Tips - smoothdeveloper/home GitHub Wiki

large queries

  • when joining on same table more than once, use a CTE (use CTE anyways for maintainability)
  • order of joins matters, join on sets likely to be the largest the latest
  • avoid joining on expressions if it is possible to join on physical columns (or expression defined in an index, but need to check that the index is used)