問題文
One monthly settlement query is far slower than every other query of similar size on the same server, and its plan runs on a single thread while the others run in parallel. The query calls a multistatement Transact-SQL scalar function once per row. Which statement identifies the root cause?
選択肢
- The scalar function is missing its own execution plan, so the engine reparses and reoptimizes it for every call.
- The function body contains several statements, and a multistatement function returns a single value declared in its RETURNS clause, which the engine must materialize for each row before the plan can go parallel.
- Transact-SQL user-defined functions in a query can only be executed on a single thread, so using one inhibits parallel query processing for that query.
- The query lacks statistics on the function's argument, so the optimizer cannot estimate a degree of parallelism.