The approach of substitution-based MV matching is an effective way for its simplicity and extensibility.
This JIRA proposes to refine existing implementation by several points:
- Canonicalize before MV matching -- by such canonicalization we can significantly simplify the algebra tree and lower the difficulty for materialization matching.
- Separate matching rules into two categories and enumerate common matching patterns which need to be covered by rules.
Please check the design doc: Design Doc