enhance: type-aware bidirectional in/== or expression rewriting#48544
Open
zhengbuqian wants to merge 1 commit intomilvus-io:masterfrom
Open
enhance: type-aware bidirectional in/== or expression rewriting#48544zhengbuqian wants to merge 1 commit intomilvus-io:masterfrom
zhengbuqian wants to merge 1 commit intomilvus-io:masterfrom
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zhengbuqian The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
[ci-v2-notice] To rerun ci-v2 checks, comment with:
If you have any questions or requests, please contact @zhikunyao. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #48544 +/- ##
==========================================
- Coverage 77.82% 77.76% -0.07%
==========================================
Files 2112 2112
Lines 354195 354294 +99
==========================================
- Hits 275665 275517 -148
- Misses 70202 70415 +213
- Partials 8328 8362 +34
🚀 New features to boost your workflow:
|
2a361a6 to
9a7587d
Compare
Collaborator
Author
|
/ci-rerun-ut-go |
Collaborator
Author
|
/ci-rerun-e2e-default |
9a7587d to
04ba149
Compare
…with PK optimization Introduce smart expression rewriting that chooses between TermExpr (IN) and UnaryRangeExpr (== or) based on data type characteristics: - Integer types: use IN when count >= 10 - Floating types: use IN when count >= 15 - String/other types: use IN when count >= 3 - Primary key fields: always use IN (PK is sorted, IN uses efficient two-pointer binary search, 60-117x faster than == or for 100 values) The rewriting is bidirectional: - combineOrEqualsToIn: merges == or chains into IN above threshold - visitTermExpr: splits IN into == or below threshold - Both directions respect the same type-aware thresholds and PK override Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
04ba149 to
11c395c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the fixed threshold (150) for merging == or into in[] with type-specific thresholds based on benchmark data:
The rewriting is now bidirectional:
Both directions use the same shouldUseInExpr function to ensure consistency.
issue: #45525