-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Description
Problem
max_codes only works with parallel_mode=0/3. For single-query scenarios, parallel_mode=1 is preferred, but there's no way to limit scan depth per inverted list.
Use Case
In real-time search with dynamic data, hot events can cause some inverted lists to grow to millions of vectors (vs. hundreds expected). This causes severe latency spikes when queries hit these lists.
Proposed Solution
Add max_codes_per_list parameter to limit scan depth per individual list, working with all parallel modes.
// In SearchParametersIVF
size_t max_codes_per_list = 0; // 0 = no limitWhy not existing solutions?
max_codes + parallel_mode=0: Loses intra-query parallelism- Reduce
nprobe: Too coarse, hurts recall - Retrain index: Doesn't handle dynamic hot spots
Implementation
Minimal change (~10 lines). Happy to contribute a PR if this approach is acceptable.
Reactions are currently unavailable