Skip to content

perf: reuse hash values across partial aggregation, repartition, and final - #2

Closed
naman-modi wants to merge 1 commit into
mainfrom
agg-hashreuse
Closed

perf: reuse hash values across partial aggregation, repartition, and final#2
naman-modi wants to merge 1 commit into
mainfrom
agg-hashreuse

Conversation

@naman-modi

Copy link
Copy Markdown
Collaborator

What does this PR do?

Carries the group-key hash from the partial aggregation through the hash repartition into the final aggregation, so it is computed once per row instead of at each stage (upstream PR apache#23720 applied onto this line).

Testing

Local: datafusion-physical-plan (1571) + datafusion-physical-expr-common (75) unit tests green; the PR's own execution test suite (45 tests incl. hash_reuse) green.

Merge gate: held open until the engine-level benchmark confirms the gain; merged only if kept.

…final aggregation

Apply upstream PR apache#23720: the group-key hash computed by the partial aggregation is carried through the hash repartition and reused by the final aggregation instead of being recomputed at each stage.
@naman-modi

Copy link
Copy Markdown
Collaborator Author

Engine-level benchmark showed no gain (flat to slightly negative on the aggregate-heavy suite), so this is not kept. The hash-reuse idea stays available on branch agg-hashreuse if the picture changes.

@naman-modi naman-modi closed this Jul 22, 2026
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.

1 participant