Does Milvus Optimize to Reduce the Number of TopK Queries at Runtime? #40360
-
Dear milvus developers, I came across the file Is there any existing optimization to reduce the number of lookups at runtime? I am aware of the segment pruning optimization in Looking forward to any insights—thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
In milvus, data is organized by segments. Each segment has an independent index.
|
Beta Was this translation helpful? Give feedback.
The PruneSegments() in segment_pruner.go only takes effect when there is a clustering key in collection schema.
milvus/internal/querynodev2/delegator/segment_pruner.go
Line 50 in be4d095
With clustering key, all data is organized into segments with a certain sequence, so that PruneSegments() can quickly know which segment can be skipped for search.
The OptimizeSearchParams() in query_hook.go accepts a QueryHook interface. QueryHook is a plugin which is loaded in querynode initialization:
milvus/internal/querynodev2/server.go
Line 556 in be4d095
The m…