[Enhancement] Restore missing optimizations in DP statistics estimation#67852
Merged
kangkaisen merged 1 commit intoStarRocks:mainfrom Jan 14, 2026
Merged
[Enhancement] Restore missing optimizations in DP statistics estimation#67852kangkaisen merged 1 commit intoStarRocks:mainfrom
kangkaisen merged 1 commit intoStarRocks:mainfrom
Conversation
|
@cursor review |
…mn collection and rowcount-only rebuilds Signed-off-by: stephen <stephen5217@163.com>
412f811 to
2659684
Compare
|
Contributor
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Contributor
[FE Incremental Coverage Report]✅ pass : 24 / 24 (100.00%) file detail
|
Contributor
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Contributor
|
@cursor review |
fe/fe-core/src/main/java/com/starrocks/sql/optimizer/statistics/StatisticsCalculator.java
Show resolved
Hide resolved
Seaven
approved these changes
Jan 14, 2026
Contributor
|
@Mergifyio backport branch-4.1 |
Contributor
|
@Mergifyio backport branch-4.0 |
Contributor
❌ No backport have been createdDetails
GitHub error: |
Contributor
✅ Backports have been createdDetails
|
Merged
24 tasks
farhad-celo
pushed a commit
to farhad-celo/starrocks
that referenced
this pull request
Jan 20, 2026
…on (StarRocks#67852) Signed-off-by: Farhad Shahmohammadi <f.shahmohammadi@celonis.com>
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.



Why I'm doing:
Recent changes on
mainunintentionally dropped some performance optimizations in the DP statistics estimation hot path. Since DP join reorder callscalculateStatistics()thousands of times, the regression is amplified. This PR restores those missing optimizations to bring performance back while keeping cost/statistics semantics unchanged.What I'm doing:
PredicateColumnsMgr.recordJoinPredicate(...)underskipPredicateColumnsCollectionScope()to avoid repeated predicate-columns recording during DP stats estimation.withOutputRowCount(...)instead of rebuildingStatisticsviabuildFrom(...).build().adjustStatisticsByRowCount()fast path:withOutputRowCountfirst,Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
Note
Restores missing performance optimizations in DP stats estimation hot path without altering cost/statistics semantics.
PredicateColumnsMgr.recordJoinPredicate(...)withshouldSkipPredicateColumnsCollection()to avoid repeated recording during DP estimationwithOutputRowCount(...)in correlated inner-join estimation instead of rebuildingStatisticsStatisticsEstimateUtils.adjustStatisticsByRowCount(...):withOutputRowCountfirstWritten by Cursor Bugbot for commit 2659684. This will update automatically on new commits. Configure here.