r/SQLServer • • 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

16 comments sorted by

View all comments

Show parent comment

4

u/elephant_ua Jan 18 '26

I am not getting, while are you using hints at all if you aren't experienced with it. Optimizer is smarter than you 95% of the time. 

1

u/cute_polarbear Jan 18 '26

Me being naive following Ai. It was pretty good / accurate at certain things sql related.