Hi Wang, The implementation of the rule based rewriting algorithm follows closely the following research paper: Optimizing Queries Using Materialized Views: A Practical, Scalable Solution
"The algorithm explained in this paper is limited to SPJG subexpressions and single-table substitutes. However, this is not an inherent limitation of our approach. The algorithm can be extended to a broader class of input and substitute expressions, for example, expressions containing unions, outer joins or aggregation with grouping sets" As the authors indicate, adding support for more types joins should be visible but I guess was not done due to lack of time. It might also have an impact on the efficiency of the algorithm which in some use-cases might not be acceptable. If you search in the works citing the paper above you may find the answer that you are looking for as well as ideas on how to implement it. Best, Stamatis
