Interleaved execution

Interleaved execution changes the unidirectional pipeline between the optimization and execution phases for a single-query execution and allows plans to adapt during the optimization. This approach solves cardinality estimation issues by executing the applicable subtree and capturing accurate cardinality estimates. The optimization process is then resumed for downstream operations.

If a query references an MSTVF, especially if the query is complex, a suboptimal execution plan is not rare. The reason for this is that the estimated output from an MSTVF is fixed to 100 (prior to SQL Server 2014, it was fixed to 1). This can lead to the wrong choice of join operator, under- or overestimated memory grants, and thus result ...

Get SQL Server 2017 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.