-
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, executor: support inline projection for TopN | tidb-test=pr/2464 #58500
Conversation
Signed-off-by: “EricZequan” <[email protected]>
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.1093% 73.8020% +0.6927%
================================================
Files 1676 1681 +5
Lines 463369 470270 +6901
================================================
+ Hits 338766 347069 +8303
+ Misses 103786 102229 -1557
- Partials 20817 20972 +155
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]>
/retest |
Signed-off-by: “EricZequan” <[email protected]>
Signed-off-by: “EricZequan” <[email protected]>
Signed-off-by: “EricZequan” <[email protected]>
Signed-off-by: “EricZequan” <[email protected]>
/retest |
Signed-off-by: “EricZequan” <[email protected]>
/retest |
Signed-off-by: “EricZequan” <[email protected]>
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
/retest |
Signed-off-by: “EricZequan” <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, xzhangxian1008 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
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.