DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Nested loop versus Hash join

  1. #1
    Join Date
    Dec 2005
    Posts
    195

    Nested loop versus Hash join

    Hello,

    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

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    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.

  3. #3
    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)?

  4. #4
    Join Date
    Dec 2005
    Posts
    195
    Thanks to every one. It is just interview questions. Thanks again.

    Quote Originally Posted by jhmartin
    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)?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width