Nested loop versus Hash join
Question. regarding Nested loop versus Hash join. I read couple of article about this. What they are saying is, Nested loop joins are useful when small subsets of data are being joined and if the join condition is an efficient way of accessing the second table. My question is what is small subset of data? How can we quantify Small subset of data
Another question regardsing hash join. Hash joins are used for joining large data sets. What is large data sets?? How can we quantify large data sets??
I would appreciate if any one can answer for my questions. Thanks
Small / large data sets are subjective. There is no fixed rule to determine the volume.
Which is better, NL or HASH Join? There is no straight answer.
Think of it this way -- are you fetching the entire table, or just 5% (arbitrary number) of it? In the former you'll want a hash join, in the latter you'll want a nested loop.
Alternatively, do you want to optimize for the first N results (nested loop), or the entire result set (hash join)?
Thanks to every one. It is just interview questions. Thanks again.
Originally Posted by jhmartin
Click Here to Expand Forum to Full Width