Is there some advantage to SUBQUERY being its own JoinNode NodeType rather than a separate boolean attribute.
I'd be concerned about current or future code testing for LEAF (intending any non-join) and accidentally overlooking the subquery case.