Skip to content
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

*: fast path point select #6937

Merged
merged 21 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge commit 'b729a60e019c8fec2cbae007b5b273697cac04b8' into fast-poi…
…nt-select

Conflicts:
	plan/plan.go
	plan/stats.go
  • Loading branch information
coocood committed Jul 16, 2018
commit 4942f47cbdb5a2827914fec1fa142758bb8353cf
11 changes: 4 additions & 7 deletions plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ type Plan interface {

context() sessionctx.Context

// StatsInfo will return the statsInfo for this plan.
StatsInfo() *statsInfo
// statsInfo will return the statsInfo for this plan.
statsInfo() *statsInfo
}

// taskType is the type of execution task.
Expand Down Expand Up @@ -229,9 +229,6 @@ type PhysicalPlan interface {
// getChildReqProps gets the required property by child index.
getChildReqProps(idx int) *requiredProp

// StatsInfo will return the statsInfo for this plan.
statsInfo() *statsInfo

// StatsCount returns the count of statsInfo for this plan.
StatsCount() float64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is called by executor package to determine if the query is expensive.


Expand Down Expand Up @@ -355,8 +352,8 @@ func (p *basePlan) ID() int {
return p.id
}

// StatsInfo implements the Plan interface.
func (p *basePlan) StatsInfo() *statsInfo {
// statsInfo implements the Plan interface.
func (p *basePlan) statsInfo() *statsInfo {
return p.stats
}

Expand Down
2 changes: 1 addition & 1 deletion plan/point_select_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (fp *PointSelectPlan) SetChildren(...PhysicalPlan) {}
func (fp *PointSelectPlan) ResolveIndices() {}

func tryFastPlan(ctx sessionctx.Context, node ast.Node) Plan {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add more comment about this function.

if PreparedPlanCacheEnabled || ctx.GetSessionVars().PlanCacheEnabled {
if PreparedPlanCacheEnabled {
// plan cache not supported yet.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any plan to support fast-path with plan cache?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comment could be improved.

return nil
}
Expand Down
4 changes: 4 additions & 0 deletions plan/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func (s *statsInfo) scaleByExpectCnt(expectCnt float64) *statsInfo {
return s
}

func newSimpleStats(rowCount float64) *statsInfo {
return &statsInfo{count: rowCount}
}

func (p *basePhysicalPlan) statsInfo() *statsInfo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The golint reports error about returning unexported type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's unexported now, is this interface still needed?

return p.stats
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.