-
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
executor: track memory usage of index lookup join #6169
Conversation
executor/index_lookup_join.go
Outdated
@@ -216,6 +227,12 @@ func (e *IndexLookUpJoin) getFinishedTask(ctx context.Context) (*lookUpJoinTask, | |||
if task != nil && task.cursor < task.outerResult.NumRows() { | |||
return task, nil | |||
} | |||
if task != nil { | |||
// TODO: jianzhang.zj detach this memory tracker after PR: |
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.
remove this comment
/run-all-tests |
executor/index_lookup_join.go
Outdated
for _, b := range e.innerPtrBytes { | ||
ptr := *(*chunk.RowPtr)(unsafe.Pointer(&b[0])) | ||
matchedInner := task.innerResult.GetRow(ptr) | ||
task.matchedInners = append(task.matchedInners, matchedInner) | ||
} | ||
newMemUsage := int64(cap(task.matchedInners)) * int64(unsafe.Sizeof(chunk.Row{})) | ||
task.memTracker.Consume(newMemUsage - oldMemUsage) |
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's a frequent operation and the matchedInners
takes a very small proportion of the memory of the task.
How about just ignore it?
executor/index_lookup_join.go
Outdated
} | ||
task.memTracker.Consume(int64(cap(task.matchedInners)) * int64(unsafe.Sizeof(chunk.Row{}))) |
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.
matchedInners
is empty at the moment.
LGTM |
/run-all-tests |
1 similar comment
/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
track memory usage of index lookup join, after this PR: