Skip to main content

What is SARGability and why is it critical for performance?

Senior MS SQL
Quick Answer SARGable (Search ARGument ABLE) expressions let SQL Server use an index to seek matching rows. Non-SARGable expressions wrap the column in a function or implicit conversion รขโ‚ฌโ€ forcing a scan. SARGable: WHERE LastName = 'Smith'. Non-SARGable: WHERE UPPER(LastName) = 'SMITH' or WHERE CAST(Id AS varchar) = '123'.

Answer

SARGability (Search ARGument-ability) describes whether a predicate can efficiently use an index to seek rows instead of scanning.

SARGable predicates:

  • Simple comparisons like Column = @Value, Column >= @Start AND Column <= @End.
  • Allow the optimizer to perform index seeks and range scans.

Non-SARGable patterns:

  • Applying functions to columns: WHERE LOWER(Col) = 'abc'.
  • Expressions on the left side: WHERE Col + 1 = 10.
  • Implicit conversions that change the column's data type.
  • Leading wildcards: LIKE '%abc'.

Ensuring predicates are SARGable is one of the most impactful techniques in query tuning: it allows indexes to be used effectively, minimizing reads and dramatically improving performance.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice