Speeding up temp table joins in SQL Server
join, sql, sql-server, sql-server-2005, temp-tables
Solution
I believe you can create indexes on temporary tables as on any other tables.
Problem
I have 2 temp tables #temp1 and #temp. Both have a key and date columns. Both have around 25k rows. And I'm left joining them on the basis of the key and date which are unique on all rows. It's taking around 4 minutes for this join to complete. Is there any way to speed it up or any alternative methods?