Fuse filterless AVG release - #25
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for reviewing.
Summary
priv_filterless_avgaggregateThis is stacked on #24 because it consumes the paired lower partials introduced there.
Why
The nonce was carried through every row and aggregate state but never influenced the secure DP randomness. Removing it reduces state and expression plumbing without changing release behavior.
AVG previously scanned the upper per-PU stream twice (once for SUM and once for COUNT) and then added a ratio projection. The fused aggregate performs the same component updates/releases in one upper pass and returns the ratio directly, including NULL for a nonpositive released count.
Validation
ninja -C build/release -j4build/release/test/unittest "test/sql/dp_filterless.test"— 161 assertionsbuild/release/test/unittest— 7,450 assertionsbuild/release/extension/privacy/pac_test_runnergit diff --checkThe focused tests verify the fused plan shape, mixed SUM/COUNT/AVG results, all-NULL AVG semantics, and exact HUGEINT/DECIMAL lower partials.
Performance
Isolated 30M-row upper-stage runs:
The full SF30 query remains lower-stage dominated; warm end-to-end runs were effectively tied (3.69s vs 3.66s) with identical results.