If there is a materialized view V=A join B, there is a stored materialized view table, Vt, which contains the result of the join of A and B. Since this is a valid way to obtain the join sub-expression, the table of alternatives 300 is augmented with this alternative to form an augmented table 500 in FIG. 5.