In SQL Server 2017, when the query optimizer encounters code with a multi-statement TVF, the query optimizer will pause optimization, execute the TVF subtree to get a very accurate cardinality ...
As a consultant whose job description includes putting out performance fires, I get to see a lot of problematic queries that can dramatically harm overall server performance and throughput. Wondering ...