It would be nice to have more sophisticated optimization strategies for FILTER expressions. This optimizer may apply strategies such as
- the elimination of duplicate filter expressions,
- decomposition of complex conjunctive filter expressions (to make the components pushable independently),
- reordering of filters (where it makes sense)
The optimizer should run before running the ASTAttachJoinFilterRewriter, and improve the outcome of the latter.