-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>tech debtTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
Description
Currently, ES|QL lacks two major performance improvements aspects for aggregations (stats):
- planner (LogicalPlanOptimizer component) propagation of foldable expressions into aggregations. This is mainly about extending the functionality in
PropagateEvalFoldablesoptimization rule. - short-circuiting
nullhandling in aggregation functions so that aggregations onnullconstant do not reach the compute engine and is already computed locally. There are multiple already created issues about this.
A first attempt at addressing this introduced too many workarounds to be considered valuable and merge-worthy:
- Calling
SubstituteSurrogatestwice. TheSubstituteSurrogatesrule should be called only once, its role shouldn't be a partial mechanism for dealing with constants in aggregate functions, as it happens now. - surrogate expression replacement before the entire set of constants have been folded and propagated can introduce issues for validation of arguments correctness. See this situation where currently this is an issue. More about this concept here and here as well.
- having
SubstituteSurrogatesbe called twice introduced yet another issue and broke existent working behavior
As a consequence, aggregations must support a specific mechanism in which they can provide a result given they receive constants as arguments, probably in the form of an interface. This should also come with support in the LogicalPlanOptimizer in the form of a new rule + changes to existent rules that deal with folding, null folding and constants propagation.
Metadata
Metadata
Assignees
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL>tech debtTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)