ORCA: add gp_orca_use_streaming_hashagg GUC to control streaming hashagg#1681
Merged
yjhjstz merged 1 commit intoapache:mainfrom Apr 21, 2026
Merged
ORCA: add gp_orca_use_streaming_hashagg GUC to control streaming hashagg#1681yjhjstz merged 1 commit intoapache:mainfrom
yjhjstz merged 1 commit intoapache:mainfrom
Conversation
Contributor
|
Given the motivation is observed plan changes on TPC-H, an explain-plan test toggling the GUC and asserting Streaming Partial HashAggregate → HashAggregate would lock in the behavior and prevent silent regressions. No regression test is added. |
Contributor
|
Commit message ends with hash…agg (literal ellipsis from the editor clipping). Should be rewritten as a clean title ≤72 chars, e.g. ORCA: add optimizer_use_streaming_hashagg GUC. |
my-ship-it
reviewed
Apr 20, 2026
ORCA unconditionally sets stream_safe=true for all local HashAggs in FLocalHashAggStreamSafe, so the existing gp_use_streaming_hashagg GUC (which is only read by the Postgres planner path in cdbgroupingpaths.c) has no effect when optimizer=on. There was no way to disable streaming hash agg for ORCA plans. Introduce optimizer_use_streaming_hashagg (default on) and wire it through the standard CConfigParamMapping path: map it (negated) to a new EopttraceDisableStreamingHashAgg traceflag, and check that traceflag in FLocalHashAggStreamSafe. When the GUC is off, ORCA emits a non-streaming Partial HashAggregate that spills to disk and fully deduplicates.
7d6f31e to
aae5613
Compare
reshke
approved these changes
Apr 21, 2026
oppenheimer01
pushed a commit
to oppenheimer01/cloudberrydb
that referenced
this pull request
May 3, 2026
ORCA unconditionally sets stream_safe=true for all local HashAggs in FLocalHashAggStreamSafe, so the existing gp_use_streaming_hashagg GUC (which is only read by the Postgres planner path in cdbgroupingpaths.c) has no effect when optimizer=on. There was no way to disable streaming hash agg for ORCA plans. Introduce optimizer_use_streaming_hashagg (default on) and wire it through the standard CConfigParamMapping path: map it (negated) to a new EopttraceDisableStreamingHashAgg traceflag, and check that traceflag in FLocalHashAggStreamSafe. When the GUC is off, ORCA emits a non-streaming Partial HashAggregate that spills to disk and fully deduplicates.
oppenheimer01
pushed a commit
that referenced
this pull request
May 4, 2026
ORCA unconditionally sets stream_safe=true for all local HashAggs in FLocalHashAggStreamSafe, so the existing gp_use_streaming_hashagg GUC (which is only read by the Postgres planner path in cdbgroupingpaths.c) has no effect when optimizer=on. There was no way to disable streaming hash agg for ORCA plans. Introduce optimizer_use_streaming_hashagg (default on) and wire it through the standard CConfigParamMapping path: map it (negated) to a new EopttraceDisableStreamingHashAgg traceflag, and check that traceflag in FLocalHashAggStreamSafe. When the GUC is off, ORCA emits a non-streaming Partial HashAggregate that spills to disk and fully deduplicates.
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.
TPC-H SF=10 Performance Change Summary
Overall Result
Total runtime: 274,201 ms → 245,672 ms (−10.4%, saved 28.5s)
Root Cause of Plan Changes
All plan diffs follow the same pattern:
Streaming Partial HashAggregate→HashAggregate.Per-Query Changes
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions