Skip to content

bench: Add benchmarks for ordered ARRAY_AGG and STRING_AGG - #24391

Open
lyne7-sc wants to merge 1 commit into
apache:mainfrom
lyne7-sc:bench/ordered-array-agg
Open

bench: Add benchmarks for ordered ARRAY_AGG and STRING_AGG#24391
lyne7-sc wants to merge 1 commit into
apache:mainfrom
lyne7-sc:bench/ordered-array-agg

Conversation

@lyne7-sc

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Add benchmarks for ordered aggregate functions, including the ordered ARRAY_AGG workload

What changes are included in this PR?

This PR adds a reusable SQL benchmark suite for aggregate functions.

The initial cases cover:

  • ARRAY_AGG with multiple ordering expressions.
  • Two ARRAY_AGG expressions with different ordering requirements.
  • STRING_AGG with multiple ordering expressions.

Are these changes tested?

Yes.

Are there any user-facing changes?

No. This PR only adds benchmarks.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.19%. Comparing base (1b67f2e) to head (5991efe).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24391      +/-   ##
==========================================
- Coverage   81.19%   81.19%   -0.01%     
==========================================
  Files        1110     1110              
  Lines      388616   388750     +134     
  Branches   388616   388750     +134     
==========================================
+ Hits       315529   315627      +98     
- Misses      54506    54535      +29     
- Partials    18581    18588       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lyne7-sc this is a neat idea to introduce a new benchmark suite. I wonder if there are any existing suites that might be better places to add this rather than a whole new suite. Or if we are going to make a new suite, shall we consolidate other benchmarks here for aggregates 🤔

FYI @Omega359 -- here is a use of the new sql benchmark suite

@Omega359

Copy link
Copy Markdown
Contributor

Thanks @alamb - it's good to know that it's being used :) I do have two PR's in progress to sync up the benchmarks with the latest changes and to impl the bench.sh linkage. I just need to find the time which is in short supply given the amazing weather right now :)

@alamb

alamb commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Thanks @alamb - it's good to know that it's being used :) I do have two PR's in progress to sync up the benchmarks with the latest changes and to impl the bench.sh linkage. I just need to find the time which is in short supply given the amazing weather right now :)

Nice -- will look forward to them (and I totally understand re weather -- it is pretty nice here too!)

@lyne7-sc

Copy link
Copy Markdown
Contributor Author

Thanks @alamb and @Omega359. The new SQL benchmark framework is very nice to use.

Most aggregate benchmarks I found focus on individual accumulator operations such as update_batch or merge_batch, making it harder to observe an aggregate’s performance and memory behavior across the complete query execution path. I also considered aggregate_query_sql.rs, but benchmarking aggregate functions often requires a broad range of workloads and data distributions, and the new SQL benchmark framework seems more flexible for defining and extending those cases.

If this direction makes sense, I think we could migrate the other end-to-end aggregate cases into this suite. Alternatively, if there is another existing suite or location that would be a better fit, I’m happy to move these cases there.

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.

4 participants