Then all three-relation query plans are computed, by joining each two-relation plan produced by the previous phase with the remaining relations in the query.
Sort order can avoid a redundant sort operation later on in processing the query.