### Description

In cases where the same agg is used, instead of computing it multiple times, make another reference to it:
```
stats a = min(x), b = min(x) by z
```

should become
```
stats a = min(x) by z
eval b = a
keep a,b,z
```

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizer.java
public LogicalPlan optimize(LogicalPlan verified) {
        return verified.optimized() ? verified : execute(verified);
    }
    @Override
    protected List<Batch<LogicalPlan>> batches() {
        return rules();
    }
    protected static List<Batch<LogicalPlan>> rules() {
        var substitutions = new Batch<>(
            "Substitutions",
            Limiter.ONCE,
            new SubstituteSurrogates(),
            new ReplaceRegexMatch(),
            new ReplaceAliasingEvalWithProject()
            
        );
        var operators = new Batch<>(
            "Operator Optimization",
            new CombineProjections(),
            new CombineEvals(),
            new PruneEmptyPlans(),
            new PropagateEmptyRelation(),
            new ConvertStringToByteRef(),
            new FoldNull(),
            new SplitInWithFoldableValue(),
            new ConstantFolding(),
            new PropagateEvalFoldables(),