-
Notifications
You must be signed in to change notification settings - Fork 285
support filter on dist func in Reader #23183
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
base: main
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #22508
What this PR does / why we need it:
PR Type
Enhancement
Description
Implement universal heap in Reader for IVFFlat index operations
Reduce code duplication by consolidating heap logic
Simplify distance calculation and filtering logic
Replace sort with slices for null filtering
Diagram Walkthrough
File Walkthrough
types.go
Add Float64Heap type and DistHeap fieldpkg/objectio/types.go
Float64Heaptype implementingheap.Interfacefor max-heapoperations
Len(),Less(),Swap(),Push(), andPop()methodsBlockReadTopOpstruct withDistHeapfield of typeFloat64Heapreader.go
Initialize DistHeap in SetBlockTop methodpkg/vm/engine/readutil/reader.go
DistHeapfield inSetBlockTop()methodread.go
Refactor to use universal Float64Heap for distancespkg/vm/engine/tae/blockio/read.go
sortimport withslicesfor null filteringHandleOrderByLimitOnIVFFlatIndex()to use universalFloat64Heapcalculations
SearchResult objects
slices.DeleteFunc()for null filtering and distance thresholdfiltering
operator.go
Update table function to use BlockLimitpkg/sql/compile/operator.go
arg.Limit = n.Limittoarg.Limit = n.BlockLimitapply_indices_ivfflat.go
Replace Limit with BlockLimit in IVFFlatpkg/sql/plan/apply_indices_ivfflat.go
tableFuncNode.LimitwithtableFuncNode.BlockLimitindex application