Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of the SUM accumulator #6878

Closed
alamb opened this issue Jul 7, 2023 · 0 comments · Fixed by #6888
Closed

Improve performance of the SUM accumulator #6878

alamb opened this issue Jul 7, 2023 · 0 comments · Fixed by #6888
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Jul 7, 2023

Is your feature request related to a problem or challenge?

While working on #6800 / #4973 I noticed that the SUM accumulators intermediate state contains two fields:

  • sum: Native
  • count: usize

Maintaining this state is on the hit path of the aggregates (e.g. TPCH Q1 has 4 of sums) thus reducing the work is performance critical

The counts are only needed for the retractable version of the accumulator (aka sliding accumulator used in window functions) but they are actually carried through all implementations.

Sum accumulator is here https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/aggregate/sum.rs

Describe the solution you'd like

I would like to remove the counts field in the sum accumulator (or only use it when we have sliding windows)

Describe alternatives you've considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant