Summary
The SQL Server optimizer has continuously improved over the years, taking advantage of new techniques and algorithms to improve its capability to find the most efficient execution plan. Understanding how queries are optimized and what information the optimizer uses to generate and select an execution plan will help you write more efficient queries and choose better indexes. To help the optimizer, you should at least try to avoid the types of nonoptimizable SARGs and other common query optimization problems discussed in this chapter.
The majority of the time, the optimizer chooses the most efficient query plan. When it doesn't, it might be because of problems with the query itself, such as poorly written SARGs and other common query performance ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access