September 5th, 2021

What’s New in SQL Server 2019: Faster Table Variables

For over a decade, SQL Server programmers had to remember: avoid using table variables with lathe count of rows in them. The reason was their low performance in that case:
making an execution plan, SQL Server estimated a table variable as always having 1 row (even in fact the the table variable had millions of rows).
"...Now, SQL Server 2019 estimates 800K rows will come out of the table variable – still not exactly accurate, but a hell of a lot more accurate than estimating 1 row..."