Skip to content

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

Merged
nik9000 merged 6 commits intoelastic:7.xfrom
nik9000:filters_sub_ok_7_x
Mar 5, 2021
Merged

Speed up aggs with sub-aggregations (backport of #69806)#69940
nik9000 merged 6 commits intoelastic:7.xfrom
nik9000:filters_sub_ok_7_x

Conversation

@nik9000
Copy link
Copy Markdown
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