Skip to content

Speed up aggs with sub-aggregations (backport of #69806) #69940

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 6 commits into from
Mar 5, 2021

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 3, 2021

This allows many of the optimizations added in #63643 and #68871 to run
on aggregations with sub-aggregations. This should:

  • Speed up terms aggregations on fields with less than 1000 values that
    also have sub-aggregations. Locally I see 2 second searches run in 1.2
    seconds.
  • Applies that same speedup to range and date_histogram aggregations but
    it feels less impressive because the point range queries are a little
    slower to get up and go.
  • Massively speed up filters aggregations with sub-aggregations that
    don't have a parent aggregation or collect "other" buckets. Also
    save a ton of memory while collecting them.

nik9000 added 6 commits March 3, 2021 18:23
This allows many of the optimizations added in elastic#63643 and elastic#68871 to run
on aggregations with sub-aggregations. This should:
* Speed up `terms` aggregations on fields with less than 1000 values that
  also have sub-aggregations. Locally I see 2 second searches run in 1.2
  seconds.
* Applies that same speedup to `range` and `date_histogram` aggregations but
  it feels less impressive because the point range queries are a little
  slower to get up and go.
* Massively speed up `filters` aggregations with sub-aggregations that
  don't have a `parent` aggregation or collect "other" buckets. Also
  save a ton of memory while collecting them.
nested docs get in the way
@nik9000 nik9000 merged commit b9dc491 into elastic:7.x Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant