r/SQLServer • u/cute_polarbear • Jan 18 '26
Question Sql hashjoin against large table
Hi,
I have a temp table indexes on int Id, joining to a large table (1billion+) rows indexed on int id, both unique, 1 to 1. Temp table can be few hundred rows to hundred of thousand rows. Does it make sense to do a hashjoin in this scenario or normal inner join? Thank you.
4
Upvotes
View all comments
Show parent comment
1
u/cute_polarbear Jan 18 '26
Right. From my limited sql experience, I would think both joining on an indexed Id column (even if 2nd table in the billion+), normal loop join is still the ideal join. I actually never (had to) use hash join, solarwinds and Ai suggestion (from trace logs and code) sending me down this rabbit hole.