What does "SARGable" mean in the context of a WHERE clause predicate, and why does it matter for performance?
Correct! Well done.
Incorrect.
The correct answer is B) A SARGable (Search ARGument-able) predicate is written in a form the optimizer can use with an index seek (e.g. "column = value"), whereas wrapping a column in a function (e.g. "YEAR(date_col) = 2024") often prevents index usage, forcing a full scan
Correct Answer
A SARGable (Search ARGument-able) predicate is written in a form the optimizer can use with an index seek (e.g. "column = value"), whereas wrapping a column in a function (e.g. "YEAR(date_col) = 2024") often prevents index usage, forcing a full scan
For an index to be used efficiently, the predicate generally must leave the indexed column unmodified on one side of the comparison; applying functions to the column (non-SARGable predicates) typically forces a full scan since the index is stored on the raw column values.