-
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: don't DoOptimze when build show #12005
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12005 +/- ##
===========================================
Coverage 81.9889% 81.9889%
===========================================
Files 447 447
Lines 98362 98362
===========================================
Hits 80646 80646
Misses 12136 12136
Partials 5580 5580 |
3088f5b
to
413f81a
Compare
executor/compiler.go
Outdated
@@ -30,7 +30,7 @@ import ( | |||
|
|||
var ( | |||
stmtNodeCounterUse = metrics.StmtNodeCounter.WithLabelValues("Use") | |||
stmtNodeCounterShow = metrics.StmtNodeCounter.WithLabelValues("Show") | |||
stmtNodeCounterShow = metrics.StmtNodeCounter.WithLabelValues("LogicalShow") |
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.
Show
is better?
return nil, err | ||
} | ||
return substitutePlaceHolderDual(physical, p), nil | ||
return proj, 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.
Do we need to eliminate projection here?
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.
Prvious one is not a valid project elimination.
For now, show cannot remove any of its output column.
So the project should be remained.
Also note that, now the output is logical plan. It will pass all optimizations. So the project cannot be removed now.
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.
Prvious one is not a valid project elimination.
For now, show cannot remove any of its output column.
So the project should be remained.
Sorry I didn't understand this, please explain a little bit more. Also, shall we set flagEliminateProjection
of b.optFlag
here?
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.
Oh, sorry i misread the comment.
We can add flag here.
But the project in the that test won't be removed
// DeriveStats implement LogicalPlan DeriveStats interface. | ||
func (p *LogicalShow) DeriveStats(childStats []*property.StatsInfo) (*property.StatsInfo, error) { | ||
profile := &property.StatsInfo{ | ||
RowCount: 1, |
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.
Add a comment to explain the reason?
7e9c510
to
c418b2e
Compare
/run-unit-test |
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.
LGTM
@@ -41,6 +41,20 @@ func (p *LogicalTableDual) DeriveStats(childStats []*property.StatsInfo) (*prope | |||
return p.stats, nil | |||
} | |||
|
|||
// DeriveStats implement LogicalPlan DeriveStats interface. |
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.
implement -> implements
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.
@winoros Please resolve the conflicts and LGTM.
/run-all-tests |
What problem does this PR solve?
A quick change to make
buildShow
in plan building more reasonable.What is changed and how it works?
Put it as a source of the
TableDual
.Check List
Tests
Code changes