[prev] 5 [next]

Exercise 1: Join Size Estimation

How many tuples are in the output from:

  1. select * from R, S where R.s = S.id
    where S.id is a primary key and R.s is a foreign key referencing S.id
  2. select * from R, S where R.s <> S.id
    where S.id is a primary key and R.s is a foreign key referencing S.id
  3. select * from R, S where R.x = S.y
    where R.x and S.y have no connection except that dom(R.x)=dom(S.y)

Under what conditions will the first query have maximum size?