Hi Wang, As Stamatis said, the paper[1] indicates that the rewriting algorithm can be extended to support outer join. But I think it is not as easy as it says. Another paper[2] is about how to support outer join in rewriting. Hope it helps.
[1] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.95.113 [2] https://dl.acm.org/doi/pdf/10.1007/s00778-006-0027-9 Best, Chunwei On Wed, May 18, 2022 at 5:41 PM Stamatis Zampetakis <zabe...@gmail.com> wrote: > 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 >