DEV Community

Discussion on: Diving into performance of Elasticsearch aggregations

Collapse
 
buinauskas profile image
Evaldas Buinauskas

Does query complexity make a huge impact?

I see you ran a simple text search within filter scope. How about cases when you have bool queries within bool queries or even nested ones?

This was a really nice article though, I never considered running aggregations using msearch 👌

Collapse
 
raoulmeyer profile image
Raoul Meyer

Yes actually, from some of the real world queries I've seen, the complexity of the query has a significant impact on aggregation performance.

We once enhanced one of our queries, which at first had a couple of match clauses. We added another one, which matched based on a field with shingles and trigrams applied. This made aggregations applied on that subset more than 2 times slower. How much impact this would have for you depends a lot on what you're actually doing in your query of course.

Thanks, glad you liked it!