Add rule to replace subtree with materialized view