0

When we perform a join operation between two tables (say , t1 , t2 containing n1 & n2 no. of tuples respectively) on common attribute say 'B' , we visualise that each tuple of t1 is compared to each tuple of t2 and then condition on attribute B is checked. Does that mean, while performing a Join operation , Database prepare intermediate data set containing n1*n2 No of tuples & then filter the result as per the Condition on B. Don't you think this is memory inefficient?

Please somebody tell me how actually join operation is performed by db? What if t1 & t2 are too large then n1*n2 tuples cant be fit in main memory? Please explain somebody.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Abhishek Sagar
  • 1,189
  • 4
  • 20
  • 44

1 Answers1

1

I don't think nowadays join work exactly like that. It's a simplified way of looking at how RDBMS works, but not pure true. Take a look at this great post on our very own StackOverflow.

Community
  • 1
  • 1
Alejandro B.
  • 4,807
  • 2
  • 33
  • 61