GeekInterview.com
Series: Subject:
Question: 102 of 196

what are Hash, Nested loop and merge-sorted Join.

Asked by: Interview Candidate | Asked on: Apr 11th, 2007
Showing Answers 1 - 2 of 2 Answers

In hash join hash table gets build using the inputs. Nested loops as the name implies uses looping construct strategy for storing and retrieving. In terms of performance comparison while retrieving data from both strictures hash join is best in terms of number of input and output operations and number of comparisons for retrieving data. But if the data to be retrieved is among the first few searches then the nested loop takes its win over the stake.

  
Login to rate this answer.

There are three types of alogrithm used by SQL compiler for joining purpose:
1) Nested join algo
2) Hash join algo
3) Merge join algo

Complier choose any one of these algo based on the best suited for performace.

1) Nested join is the used in most of the cases by the compiler
2) Hash join is used in large result set.
In this case first hash key is generated then the match is find based on the hash key.
3) Used in the cases where both the list are in sorted order.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.