-
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
executor: support index nested loop hash join #8661
Conversation
@yu34po
|
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.
@yu34po Please:
- Refine the description of this PR.
- Add performance benchmark.
/rebuild |
/run-all-tests |
@yu34po merge failed. |
/run-all-tests |
/run-all-tests |
executor/index_lookup_hash_join.go
Outdated
func (iw *indexHashJoinInnerWorker) buildHashTableForOuterResult(ctx context.Context, cancelFunc context.CancelFunc, task *indexHashJoinTask, h hash.Hash64) { | ||
rowIdx, numRows := 0, task.outerResult.NumRows() | ||
buf := make([]byte, 1) | ||
task.lookupMap = newRowHashMap() |
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.
newRowHashMap
is added an argument here, https://github.com/pingcap/tidb/pull/11937/files#diff-4f7e05240341383641662778116ddf13R236
We should merge #11937, then fix it here.
/run-all-tests |
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
/merge |
/run-all-tests |
What problem does this PR solve?
#8470
What is changed and how it works?
We'll split index_lookup_join into index_hash_join and index_merge_join.
This PR only adds the implementation for index_hash_join.
If we do not need to keep the result order as the outer plan, we'll build an index_hash_join executor. Otherwise, we use the old index_lookup_join executor.
IndexNestedLoopHashJoin employs one outer worker and N inner workers to
execute concurrently. The output order is not promised.
The execution flow is very similar to IndexLookUpReader:
inner worker channel.
Note:
step i
andstep ii
runs concurrently.Check List
Tests
Existing test case.
Code changes
Side effects
This change is