There are two distinct optimization tasks done as part of the join optimization stage:

  • Join ordering — Determines the most efficient order for performing joins among adjacent join nodes
  • Join algorithm selection — Determines the best join algorithm to use for each join node