-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: introduce new cost formula for MPPAggs #35436
planner: introduce new cost formula for MPPAggs #35436
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/7988c1245e8b2b9da82e05712302febbe2cedc68 |
wait for #35438 |
@@ -1144,6 +1164,9 @@ func (p *PhysicalExchangeReceiver) GetPlanCost(taskType property.TaskType, costF | |||
} | |||
|
|||
func getOperatorActRows(operator PhysicalPlan) float64 { | |||
if operator == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be nil in some update-statements.
@@ -326,7 +331,8 @@ func (p *PhysicalTableReader) GetPlanCost(taskType property.TaskType, costFlag u | |||
// consider concurrency | |||
p.planCost /= concurrency | |||
// consider tidb_enforce_mpp | |||
if isMPP && p.ctx.GetSessionVars().IsMPPEnforced() { | |||
if isMPP && p.ctx.GetSessionVars().IsMPPEnforced() && | |||
!hasCostFlag(costFlag, CostFlagRecalculate) { // show the real cost in explain-statements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this make a different plan when we use explain
or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I think it's expected. Currently, if we enable enforce_mpp
, all plan costs will be zero, which is weird.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7988c12
|
TiDB MergeCI notify
|
* upstream/master: planner: make some `show stmt` more fine-grained privilege check (pingcap#35493) session: improve bootstrap code (pingcap#34755) *: upgrade go-proxyprotocol version (pingcap#35560) planner: introduce new cost formula for MPPAggs (pingcap#35436)
What problem does this PR solve?
Issue Number: ref #35240
Problem Summary: introduce new cost formula for MPPAggs
What is changed and how it works?
On modelVer2: Hash/StreamAgg: use the dedicated TiFlash CPU Factor when calculating CPU costs;
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.