Skip to content

ESQL: reuse agg filter evaluation across multiple aggs in compute #116720

@bpintea

Description

@bpintea

Description

For a query like...

STATS c = count(*) WHERE a > 1,
      m = max(field) WHERE a > 1
      BY some_field

(Note: the BY will prevent the filter to be extracted outside the STATS, once #115678 is merged.)

...we're evaluating the same WHERE a > 1 twice - instead of evaluating it per agg, we should reuse its evaluation. This impacts the actual aggregation execution, to reuse the mask/input block across aggregations.

Ideally, we'd also be able to fuse masks, in case the second agg would look smth like m = max(field) WHERE a > 1 AND other_field > 0.

Related #114352

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions