Join Order Selection

Joins are associative so R⋈S⋈T⋈U are equivalent to

  1. ((R⋈S)⋈T)⋈U
  2. (R⋈S)⋈(T⋈U)
  3. R⋈(S⋈(T⋈U))

→ Try to minimize the intermediate result
Need to decide which of the subexpressions is evaluated first

Cost of nested loop join is not symmetric