Optimization criteria for nested operators changed

Only when the right operator is a leaf the optimiser will place a
nested operator (join or optional)