Question 130
An order total is recomputed for every row using a scalar UDF and execution becomes slow. Which verification finding is most specific to this scenario?
Explanation
Correct Answer
Row-by-row function evaluation can inhibit query optimization; set-based evaluation often scales better. The observation “The batch returns the same totals with lower CPU time on representative volumes” directly confirms the chosen action worked for this situation: An order total is recomputed for every row using a scalar UDF and execution becomes slow.
Incorrect Answers
A standard view stores query definition rather than a separately refreshed result set. This observation would not establish that the required result occurred for An order total is recomputed for every row using a scalar UDF and execution becomes slow. The confirming test is: The batch returns the same totals with lower CPU time on representative volumes.
INSTEAD OF logic replaces the direct DML action; AFTER logic runs after a supported modification. This observation would not establish that the required result occurred for An order total is recomputed for every row using a scalar UDF and execution becomes slow. The confirming test is: The batch returns the same totals with lower CPU time on representative volumes.
A CTE is a named subquery scoped to a single following DML statement, not an automatic materialized table. This observation would not establish that the required result occurred for An order total is recomputed for every row using a scalar UDF and execution becomes slow. The confirming test is: The batch returns the same totals with lower CPU time on representative volumes.