Skip to content

Conversation

@rdettai-sk
Copy link
Contributor

@rdettai-sk rdettai-sk commented Oct 10, 2025

See https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-composite-aggregation

Composite aggregations are usefull to export pre-aggregated data at medium cardinailities (10k to millions).

@PSeitz-dd
Copy link
Contributor

@rdettai-sk I refactored aggregations in this PR: #2715

@rdettai-sk
Copy link
Contributor Author

Test Name Memory Avg Median Range
terms_few 27.9 KB 1.9207ms 1.8848ms [1.8192ms .. 3.1971ms]
terms_many 6.9 MB 5.7860ms 5.6407ms [5.4616ms .. 8.0505ms]
terms_many_top_1000 6.9 MB 7.3430ms 7.2118ms [6.9790ms .. 9.6555ms]
terms_many_with_avg_sub_agg 27.8 MB 42.5193ms 41.1872ms [38.9443ms .. 50.6991ms]
composite_term_many_page_1000 436.8 KB 16.4085ms 16.2403ms [15.9183ms .. 19.1130ms]
composite_term_many_page_1000_with_avg_sub_agg 2.0 MB 18.2566ms 18.0860ms [17.0605ms .. 20.9226ms]
composite_term_few 28.7 KB 12.2631ms 12.0812ms [11.7445ms .. 15.8399ms]

@rdettai-sk
Copy link
Contributor Author

Impact of the refacto:

Test Name Memory Avg Median Range
composite_term_many_page_1000 435.8 KB (-0.15%) 15.7835ms (-6.12%) 15.6270ms (-7.18%) [15.2078ms .. 19.8406ms]
composite_term_many_page_1000_with_avg_sub_agg 2.0 MB (-0.08%) 16.9791ms (-7.76%) 17.0189ms (-8.24%) [15.9805ms .. 17.7368ms]
composite_term_few 28.3 KB (-2.28%) 11.7407ms (-2.95%) 11.7378ms (-2.83%) [11.5437ms .. 11.9527ms]

@rdettai-sk rdettai-sk marked this pull request as ready for review October 23, 2025 19:54
@rdettai-sk
Copy link
Contributor Author

@PSeitz this PR is finally pretty much ready. Histogram benchmarks are a bit disappointing, I'll try to figure out why.

Benchmark Memory Avg Median Range
composite_term_many_page_1000 435.9 KB 17.1144ms 17.0872ms [16.5733ms .. 17.5875ms]
composite_term_many_page_1000_with_avg_sub_agg 2.0 MB 18.4522ms 18.4074ms [17.2280ms .. 19.0033ms]
composite_term_few 28.2 KB 12.1930ms 12.0968ms [11.6045ms .. 15.3977ms]
composite_histogram 304.0 KB 57.7002ms 57.4315ms [56.1724ms .. 59.2285ms]
composite_histogram_calendar 156.2 KB 24.1235ms 24.0230ms [23.3956ms .. 25.9654ms]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants