Question 380
A service filters an indexed customer code using LEFT(code,3) and scans the whole table. The team proposes this approach: Rewrite to a precise supported prefix range or index an appropriate computed column. Which technical principle supports this approach?
Explanation
Correct Answer
Applying a function to an indexed predicate can prevent efficient seeking. Range rewriting must respect collation and prefix edge cases.
Incorrect Answers
Wrapping an indexed column in LEFT can obstruct seek predicates. A compatible raw prefix range or indexed computed expression may help.
A parameter-side prefix expression does not standardize SQL collation behavior. Verify actual customer-code sort boundaries and seek semantics.
A status index does not directly make a function on the code index key seekable. Match the access path to code-prefix predicates.