ESQL: Group by all optimization#139130
Merged
leontyevdv merged 14 commits intoelastic:mainfrom Dec 12, 2025
Merged
Conversation
Normalizes ordinals so that each unique tsid uses the first ordinal encountered for that tsid. Part of elastic#136253
Normalizes ordinals so that each unique tsid uses the first ordinal encountered for that tsid. Part of elastic#136253
Normalizes ordinals so that each unique tsid uses the first ordinal encountered for that tsid. Part of elastic#136253
Add integration test to test bare aggs _over_time Part of elastic#136253
Add test to test tsid normalization on operator layer Part of elastic#136253
Collaborator
|
Hi @leontyevdv, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
Add test to test tsid normalization on operator layer Part of elastic#136253
kkrik-es
reviewed
Dec 11, 2025
.../compute/src/main/java/org/elasticsearch/compute/operator/TimeSeriesAggregationOperator.java
Show resolved
Hide resolved
kkrik-es
reviewed
Dec 11, 2025
.../compute/src/main/java/org/elasticsearch/compute/operator/TimeSeriesAggregationOperator.java
Show resolved
Hide resolved
Fix the time-series-aggregation-functions.md
kkrik-es
approved these changes
Dec 12, 2025
parkertimmins
pushed a commit
to parkertimmins/elasticsearch
that referenced
this pull request
Dec 17, 2025
Normalizes ordinals so that each unique tsid uses the first ordinal encountered for that tsid. Part of elastic#136253 --------- Co-authored-by: Nhat Nguyen <nhat.nguyen@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Normalizes ordinals so that each unique tsid uses the first ordinal encountered for that tsid.
The FirstDocIdGroupingAggregatorFunction collects the first doc id for each group. With time-buckets, the same tsid can appear in multiple groups. When loading the dimension field, this may result in loading multiple documents for the same tsid several times.
There are two options:
may load the same document multiple times for the same tsid, but not different documents. The overhead of loading the
same document multiple times is small compared to loading different documents for the same tsid.
This implementation uses the second option as it is a more contained change.
Example:
Part of #136253