```
row x = 1, y = 2, z = 3 | stats  a = count(*), b = count(*) | stats  c = count(*)
```

The logical optimizer does not seem to be able to handle this query:

```
{
    "error": {
        "root_cause": [
            {
                "type": "rule_execution_exception",
                "reason": "Rule execution limit [100] reached"
            }
        ],
        "type": "rule_execution_exception",
        "reason": "Rule execution limit [100] reached"
    },
    "status": 500
}
```

The problem seems to be limited to this corner case scenario where you have two aggs with the same expression in one STATS and another STATS after that.

The problem is not limited to `count(*)`, also the following fails with the same error

```
row x = 1, y = 2, z = 3 | stats  a = max(x), b = max(x) | stats  c = max(a)
```

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizer.java
* Pushes Evals past OrderBys. Although it seems arbitrary whether the OrderBy or the Eval is executed first,
     * this transformation ensures that OrderBys only separated by an eval can be combined by PushDownAndCombineOrderBy.
     *
     * E.g.:
     *
     * ... | sort a | eval x = b + 1 | sort x
     *
     * becomes
     *
     * ... | eval x = b + 1 | sort a | sort x
     *
     * Ordering the evals before the orderBys has the advantage that it's always possible to order the plans like this.
     * E.g., in the example above it would not be possible to put the eval after the two orderBys.
     */
    protected static class PushDownEval extends OptimizerRules.OptimizerRule<Eval> {
        @Override
        protected LogicalPlan rule(Eval eval) {
            LogicalPlan child = eval.child();
            if (child instanceof OrderBy orderBy) {
                return orderBy.replaceChild(eval.replaceChild(orderBy.child()));
            } else if (child instanceof Project) {
                var projectWithEvalChild = pushDownPastProject(eval);
                var fieldProjections = asAttributes(eval.fields());
                return projectWithEvalChild.withProjections(mergeOutputExpressions(fieldProjections, projectWithEvalChild.projections()));
            }
            return eval;
        }
    }
    
    protected static class PushDownRegexExtract extends OptimizerRules.OptimizerRule<RegexExtract> {