-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
support hash join in new plan #1234
Conversation
@@ -0,0 +1,45 @@ | |||
// Copyright 2015 PingCAP, Inc. |
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.
2015 -> 2016
You can add a function in
So you will never forget to call one of them. |
if sel.From != nil { | ||
p = b.buildNewSinglePathPlan(sel.From.TableRefs) | ||
if sel.Where != nil { | ||
p = b.buildFilter(p, sel.Where) |
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.
If where
is all pushed down, this would be redundant?
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.
we build filter first and then apply predicate pushing down. when finishing it, this filter can be removed.
} | ||
|
||
func (ce *columnsExtractor) Leave(expr ast.Node) (ret ast.Node, ok bool) { | ||
return expr, false |
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.
return expr, true
ec90efb
to
4915b5b
Compare
Add a simple benchmark for join like: https://github.com/pingcap/tidb/blob/master/bench_test.go#L160 |
case plan.LeftOuterJoin: | ||
e.outter = true | ||
e.leftSmall = false | ||
big, small = 0, 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.
What's this 0 and 1 mean? Please add comment or use const.
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.
e.leftSmall is enough for deciding which child will be used for smallExec. So big/small is redundant.
} | ||
} | ||
} | ||
return inNode, false |
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.
return inNode, true
5bdafd3
to
3670a3d
Compare
LGTM |
@shenli PATL |
) | ||
|
||
// Error codes. | ||
const ( | ||
CodeUnsupportedType terror.ErrCode = 1 | ||
SystemInternalError terror.ErrCode = 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.
1 -> 2 ?
496c6a1
to
9b5a3b1
Compare
LGTM |
@@ -1,4 +1,4 @@ | |||
// Copyright 2015 PingCAP, Inc. |
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.
2016 -> 2015 ?
9b5a3b1
to
b526229
Compare
support hash join