I'm running on SQL Server 2019. Whenever I write a query of the form
SELECT *
FROM [Multi-Statement-Table-Valued-Function]
the execution plan shows that it expected to get 100 rows from this process. Is this a consistent and documented pattern? Or is it just a quirk of my server?
I have a set of notes on cardinality estimation from SQL Server 2014 and I'm confident that the estimation methods haven't changed since 2014, but they make no mention of this magic number.
Source
Later versions (compatibility level >= SQL Server 2017) have interleaved execution which is also discussed in that source.
Testing in 2022 the
100estimate is still used as an initial estimate when getting an "estimated" plan - but the interleaved execution means that this plan will be replaced.One other relevant passage from the above article is