Simple extension for AbstractMaterializedViewRule to support case when view contains a subset of the tables of the query and tables are joined in different order in the query and view plans.
View (m0): (A JOIN B) JOIN C
Query: (((A JOIN B) JOIN D) JOIN C) JOIN E
MV rewriting: ((m0 JOIN D) JOIN E)
Basically, once we have found the missing tables, we add them to the view and view plan. Then the rewriting algorithm works the same way and will enforce any predicate that is in the query and not in the view.