Skip to content

Commit 874a697

Browse files
authored
Emit ordinal output block for values aggregate (#127201)
Time-series aggregations rely heavily on the `values` aggregation for collecting grouping values. For example: ``` TS k8s | STATS max(rate(request)) BY host ``` is translated to: ``` TS k8s | STATS rate(request), VALUES(host) BY _tsid | STATS max(`rate(request)`) BY host=`VALUES(host)` ``` We might change how these are executed later, but for now, we need to optimize the `values` aggregation for `BytesRef`, especially in cases with low cardinality. This change emits ordinal blocks as the output of the `values` aggregation, allowing the second aggregation to execute more efficiently. I will also open a PR to handle incoming ordinal blocks for the `values` aggregation.
1 parent 680ecf8 commit 874a697

File tree

7 files changed

+255
-136
lines changed

7 files changed

+255
-136
lines changed

docs/changelog/127201.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127201
2+
summary: Emit ordinal output block for values aggregate
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregator.java

Lines changed: 70 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesDoubleAggregator.java

Lines changed: 25 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesFloatAggregator.java

Lines changed: 25 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesIntAggregator.java

Lines changed: 25 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesLongAggregator.java

Lines changed: 25 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)