Skip to content

Optimize ordinal inputs in Values aggregation (#127849) #129009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jun 5, 2025

Backport of #127849 to 8.19.

Currently, time-series aggregations use the values aggregation to collect dimension values. While we might introduce a specialized aggregation for this in the future, for now, we are using values, and the inputs are likely ordinal blocks. This change speeds up the values aggregation when the inputs are ordinal-based.

Execution time reduced from 461ms to 192ms for 1000 groups.

ValuesAggregatorBenchmark.run    BytesRef     10000  avgt    7  461.938 ± 6.089  ms/op
ValuesAggregatorBenchmark.run    BytesRef     10000  avgt    7  192.898 ± 1.781  ms/op

@dnhatn dnhatn added backport :Analytics/ES|QL AKA ESQL v8.19.0 auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jun 5, 2025
Currently, time-series aggregations use the `values` aggregation to
collect dimension values. While we might introduce a specialized
aggregation for this in the future, for now, we are using `values`, and
the inputs are likely ordinal blocks. This change speeds up the `values`
aggregation when the inputs are ordinal-based.

Execution time reduced from 461ms to 192ms for 1000 groups.

```
ValuesAggregatorBenchmark.run    BytesRef     10000  avgt    7  461.938 ± 6.089  ms/op
ValuesAggregatorBenchmark.run    BytesRef     10000  avgt    7  192.898 ± 1.781  ms/op
```
@dnhatn dnhatn force-pushed the 8.19-ordinal-values branch from 2cd1efd to 78beedb Compare June 5, 2025 19:32
@dnhatn dnhatn marked this pull request as ready for review June 6, 2025 00:02
@dnhatn dnhatn merged commit fbeed15 into elastic:8.19 Jun 6, 2025
15 checks passed
@dnhatn dnhatn deleted the 8.19-ordinal-values branch June 6, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport v8.19.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant