### Description

As we have more rules doing analysis across plans, a number of methods are useful to add to the `QueryPlan` class itself, mainly around expressions:

```
- expressions() - return the expressions declared by this plan
- references() - return the references from the expressions above
```
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizer.java
);
            } else if (child instanceof Eval eval) {
                
                var attributes = new AttributeSet(Expressions.asAttributes(eval.fields()));
                plan = maybePushDownPastUnary(filter, eval, attributes::contains);
            } else if (child instanceof RegexExtract re) {
                
                var attributes = new AttributeSet(Expressions.asAttributes(re.extractedFields()));
                plan = maybePushDownPastUnary(filter, re, attributes::contains);
            } else if (child instanceof Enrich enrich) {
                
                var attributes = new AttributeSet(Expressions.asAttributes(enrich.enrichFields()));
                plan = maybePushDownPastUnary(filter, enrich, attributes::contains);
            } else if (child instanceof Project) {
                return pushDownPastProject(filter);
            } else if (child instanceof OrderBy orderBy) {
                
                plan = orderBy.replaceChild(filter.with(orderBy.child(), condition));
            }
            
            return plan;
        }
        private static LogicalPlan maybePushDownPastUnary(Filter filter, UnaryPlan unary, Predicate<Expression> cannotPush) {
            LogicalPlan plan;
            List<Expression> pushable = new ArrayList<>();
            List<Expression> nonPushable = new ArrayList<>();
            for (Expression exp : Predicates.splitAnd(filter.condition())) {
                (exp.anyMatch(cannotPush) ? nonPushable : pushable).add(exp);
            }