-
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
planner: Prune topN schema for avoiding no-need column exchange #58500
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: “EricZequan” <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @EricZequan. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
Signed-off-by: “EricZequan” <[email protected]>
Signed-off-by: “EricZequan” <[email protected]>
Signed-off-by: “EricZequan” <[email protected]>
// └─Byitem: vec_distance(vec, '[1,2,3]') | ||
// └─Schema: id, vec | ||
// | ||
// New: DataSource(id, vec) -> Projection(id, vec->dis) -> TopN(by dis) -> Projection(id) | ||
// └─Byitem: dis | ||
// └─Schema: id, dis | ||
// | ||
// Note that for plan now, TopN has its own schema and does not use the schema of children. |
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.
@breezewish PTAL~
@@ -413,3 +411,36 @@ func TestVectorSearchWithPKForceTiKV(t *testing.T) { | |||
require.Equal(t, output[i].Warn, testdata.ConvertSQLWarnToStrings(tk.Session().GetSessionVars().StmtCtx.GetWarnings())) | |||
} | |||
} | |||
|
|||
func TestVectorSearchHeavyFunction(t *testing.T) { |
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.
@breezewish PTAL~
Signed-off-by: “EricZequan” <[email protected]>
/retest |
@EricZequan: Cannot trigger testing until a trusted user reviews the PR and leaves an 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 kubernetes-sigs/prow repository. |
Signed-off-by: “EricZequan” <[email protected]>
/ok-to-test |
Signed-off-by: “EricZequan” <[email protected]>
Signed-off-by: “EricZequan” <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58500 +/- ##
================================================
+ Coverage 73.5476% 73.5905% +0.0429%
================================================
Files 1681 1681
Lines 464295 467670 +3375
================================================
+ Hits 341478 344161 +2683
- Misses 102000 102661 +661
- Partials 20817 20848 +31
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: “EricZequan” <[email protected]>
/test unit-test |
@EricZequan: The specified target(s) for
Use
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 kubernetes-sigs/prow repository. |
Signed-off-by: “EricZequan” <[email protected]>
Signed-off-by: “EricZequan” <[email protected]>
@EricZequan: The following test failed, say
Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@EricZequan: The following tests failed, say
Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: ref #54245
Problem Summary:
What is changed and how it works?
Prune the TopN's schema to avoid no-needs column transmission by implementing inline projection for TopN.
The implementation is very similar to #19900
To learn more about inline projection, see: #14428
First, we modified the topN structure
logicalSchemaProducer
so that TopN can have its own schema information. Inpkg/planner/core/task.go:(PhysicalTopN) getPushedDownTopN
, we prune the schema of TopN with the columns required by the upper-level plan to avoid passing unnecessary columns.Then, in the executor part, we added
columnIdxsUsedByChild
to TopN to mark the columns that actually need to be processed. In theNext
method, the required column results are recorded inreq
according to this mark.VectorDBBench test result :
QPS improvement: 1M-768D--14%, 500K-1536D--30%
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.