Comparing table variable performance to #temp table performance.
With 100,000 rows in both tables,
select sum(numberfield) from #t takes 20ms
select sum(numberfield) from @t takes 118ms
I've compared this with different number of rows and it seems table variables are around 5 - 7 times slower
than #temp tables.
Is there any configuration change that can be done to improve their performance or is this what you'd expect ?