enhance: add channel num for queryHook optimization (#35104)

At most cases, data in each channel is almost evenly distributed, we
could utilize the channel num info to optimize searh param in queryHook

Signed-off-by: chasingegg <chao.gao@zilliz.com>
pull/34771/head
Gao 2024-07-31 18:59:49 +08:00 committed by GitHub
parent 03912a8788
commit 6695c6d0a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,9 @@ func OptimizeSearchParams(ctx context.Context, req *querypb.SearchRequest, query
common.WithOptimizeKey: paramtable.Get().AutoIndexConfig.EnableOptimize.GetAsBool(),
common.CollectionKey: req.GetReq().GetCollectionID(),
}
if withFilter && channelNum > 1 {
params[common.ChannelNumKey] = channelNum
}
err := queryHook.Run(params)
if err != nil {
log.Warn("failed to execute queryHook", zap.Error(err))

View File

@ -109,6 +109,7 @@ const (
SegmentNumKey = "segment_num"
WithFilterKey = "with_filter"
DataTypeKey = "data_type"
ChannelNumKey = "channel_num"
WithOptimizeKey = "with_optimize"
CollectionKey = "collection"