mirror of https://github.com/milvus-io/milvus.git
Remove unnecessary plan deserialization (#22056)
Signed-off-by: chasingegg <chao.gao@zilliz.com>pull/22077/head
parent
137e620a8c
commit
120164b0a2
|
@ -56,7 +56,6 @@ type searchTask struct {
|
|||
otherTasks []*searchTask
|
||||
cpuOnce sync.Once
|
||||
plan *planpb.PlanNode
|
||||
qInfo *planpb.QueryInfo
|
||||
}
|
||||
|
||||
func (s *searchTask) PreExecute(ctx context.Context) error {
|
||||
|
@ -70,21 +69,6 @@ func (s *searchTask) PreExecute(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *searchTask) init() error {
|
||||
if s.iReq.GetSerializedExprPlan() != nil {
|
||||
s.plan = &planpb.PlanNode{}
|
||||
err := proto.Unmarshal(s.iReq.GetSerializedExprPlan(), s.plan)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
switch s.plan.GetNode().(type) {
|
||||
case *planpb.PlanNode_VectorAnns:
|
||||
s.qInfo = s.plan.GetVectorAnns().GetQueryInfo()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: merge searchOnStreaming and searchOnHistorical?
|
||||
func (s *searchTask) searchOnStreaming() error {
|
||||
// check ctx timeout
|
||||
|
@ -429,9 +413,5 @@ func newSearchTask(ctx context.Context, src *querypb.SearchRequest) (*searchTask
|
|||
PlaceholderGroup: src.Req.GetPlaceholderGroup(),
|
||||
MetricType: src.Req.GetMetricType(),
|
||||
}
|
||||
err := target.init()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return target, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue