Skip to content

Commit

Permalink
enhance: add channel num for queryHook optimization (#35104)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chasingegg authored Jul 31, 2024
1 parent 03912a8 commit 6695c6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/querynodev2/optimizers/query_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const (
SegmentNumKey = "segment_num"
WithFilterKey = "with_filter"
DataTypeKey = "data_type"
ChannelNumKey = "channel_num"
WithOptimizeKey = "with_optimize"
CollectionKey = "collection"

Expand Down

0 comments on commit 6695c6d

Please sign in to comment.