4 ms·
The biggest problem with scalar UDFs is not the IO performance. It is that they force the query to serial (non-parallel). On queries that return a non-trivial q
by timlin 10y ago
The biggest problem with scalar UDFs is not the IO performance. It is that they force the query to serial (non-parallel). On queries that return a non-trivial quantity of data, that hurts.
https://www.brentozar.com/blitz/blitz-result-user-defined-functions-slowing-down-sql-server/ https://www.brentozar.com/blitz/blitz-result-user-defined-fu...
http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspx http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forci...
- Pxtl 10y agoI'm curious, how do you spot this "forces parallel" on a query plan? Or is this one of those magic things you have to just know? Would it make more sense to have a precompiler go through and inline my UDFs? They seem pretty amenable to a macro-expansion.