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
ESQL: avoid computing duplicate aggs #100544
Labels
Comments
Pinging @elastic/es-ql (Team:QL) |
elasticsearchmachine
added
the
Team:QL (Deprecated)
Meta label for query languages team
label
Oct 9, 2023
Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL) |
costin
added a commit
to costin/elasticsearch
that referenced
this issue
Oct 10, 2023
Replace duplicated aggregations in a stat with an alias (through a synthetic eval). Additionally introduce agg normalization which replaces field aliases inside agg and the literals in Count with "*". This improves the query: eval x = salary stats c = count(), m = min(x), m1 = min(salary), c1 = count(1) to stats c = count(*), m = min(x) eval m1 = m, c1 = c keep c, m, m1, c1 Fix elastic#100544
costin
added a commit
to costin/elasticsearch
that referenced
this issue
Oct 10, 2023
Replace duplicated aggregations in a stat with an alias (through a synthetic eval). Additionally introduce agg normalization which replaces field aliases inside agg and the literals in Count with "*". This improves the query: eval x = salary stats c = count(), m = min(x), m1 = min(salary), c1 = count(1) to stats c = count(*), m = min(x) eval m1 = m, c1 = c keep c, m, m1, c1 Fix elastic#100544
elasticsearchmachine
pushed a commit
that referenced
this issue
Oct 18, 2023
Replace duplicated aggregations in a stat with an alias (through a synthetic eval). Additionally introduce agg normalization which replaces field aliases inside agg and the literals in Count with "*". This improves the query: eval x = salary stats c = count(), m = min(x), m1 = min(salary), c1 = count(1) to stats c = count(*), m = min(x) eval m1 = m, c1 = c keep c, m, m1, c1 Fix #100544
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
In cases where the same agg is used, instead of computing it multiple times, make another reference to it:
should become
The text was updated successfully, but these errors were encountered: