Aggregations enhancement - better memory usage estimates to avoid circuit breaking #28220
Labels
:Analytics/Aggregations
Aggregations
>enhancement
Team:Analytics
Meta label for analytical engine team (ESQL/Aggs/Geo)
In a recent discuss forum post a user reported circuit breaking exceptions when using a large number of
avg
aggregations nested under two layers ofterms
aggregations.Internally, the estimated memory cost of handling the request was (badly) estimated to be nearly 3GB in size but the actual size should have been much smaller. In part, this is due to a one-size-fits-all cost which is added for every aggregation which is hard-coded to 5kb in the aggregator base class.
For some aggregations this is often an underestimate (e.g. cardinality agg) while for simple metric aggregations like the
avg
aggregation it is a large over-estimate (which led to the circuit breaker error in the case mentioned above).The solution requires
avg
to provide a better estimate of their memory cost.The text was updated successfully, but these errors were encountered: