Does query plan optimizer works well with joined/filtered table-valued functions?

In this case, it’s an “inline table valued function”
The optimiser simply expands (unnests) it if it’s useful (or view).

If the function is treated as “black box” by the outer query, the quickest way is to compare IO shown in SSMS vs IO in profiler.
Profler captures “black box” IO that SSMS does not.

Blog post by Adam Mechanic (his book is in my drawer at work)

Leave a Comment