On Join-Order Optimal Compositions and Optimizing Recursive Queries