-
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: do not send snapshot request for (batch) point get on temporary table #24804
executor: do not send snapshot request for (batch) point get on temporary table #24804
Conversation
executor/point_get.go
Outdated
// Global temporary table is always empty, so no need to send the request. | ||
if e.tblInfo.TempTableType == model.TempTableGlobal { | ||
return nil, 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.
How about move this part before the PointGetCache block? Do temporary tables support point get cache?
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 should not support PointGetCache
for temporary table.
That is meaningless: temporary table is in-memory already, so why should we use a another cache to complicate the problem without improving performance?
@@ -145,6 +149,16 @@ func (e *BatchPointGetExec) Open(context.Context) error { | |||
return nil | |||
} | |||
|
|||
// Global temporary table would always be empty, so get the snapshot data of it is meanless. | |||
// globalTemporaryTableSnapshot inherits kv.Snapshot and override the BatchGet methods to return empty. |
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.
Why not skip kv request just like other operators (such as point get)? It's very strange to do it in a different way.
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.
Just because the code is different.
There is no such single line of change in BatchPointGet.
/lgtm |
@djshow832: Thanks for your review. The bot only counts In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/lgtm |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 34a0edd
|
@tiancaiamao: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
An optimization, continue with #24769, this PR optimize the point get code path.
What is changed and how it works?
For the temporary table, we do not need to send request to the TiKV.
This PR handle the [batch] point get code path.
What's Changed:
If the batch/ point get is on a temporary table, let the
snapshot.get()
return directly, without sending request to TiKV.How it Works:
Global temporary table is always empty, so
snapshot.get()
on it is pointless. We can save a network round trip for those operations.Check List
Tests
Release note