How expensive is Composite Aggregation?

I'm planning to use Composite Aggregation in one of my projects and wanted to know how expensive these operations are. Specifically, I wanted to see how does the compute and memory cost increase along with following values.

  • Total cardinality of the query
  • Total number of documents in the cluster/shard/index
  • Addition of filters

Is there any downside in using the Composite Aggregation?

Most uses of the composite aggregation only visit the docs being aggregated in the current pass. The docs that don't "fit" in the range returned by the composite are mostly skipped. So generally the cost of any individual execution of composite is proportional to the number of docs with terms that fall in the next n composite sort keys and not propositional to the total number of docs in the index or that match the query.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.