tempdb, Temp Tables and Table Variables: Which One When?
Below compatibility level 150 a table variable is estimated at 1 row, and a 17,359-row join climbs to 182,749 logical reads; deferred compilation fixes the row count, but without column statistics filter estimates are still wrong. The statistics, rollback and re-evaluation differences between temp tables, table variables and CTEs, tempdb contention and data files, bulk data with TVPs, and SQL Server 2025 tempdb space resource governance.
8 Nov 2026
·
10 min
·
6