From 3938d68034e54521791e47e7bb61c4c1a1208f4a Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Sat, 25 Sep 2021 00:21:57 +0800 Subject: [PATCH] Optimize proxy query execute (#8479) Signed-off-by: yudong.cai --- internal/proxy/task.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/internal/proxy/task.go b/internal/proxy/task.go index fe2c8df79a..79b2eac676 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -2348,21 +2348,15 @@ func (qt *queryTask) Execute(ctx context.Context) error { } msgPack.Msgs[0] = tsMsg - collectionName := qt.query.CollectionName - collID, err := globalMetaCache.GetCollectionID(ctx, collectionName) + stream, err := qt.chMgr.getDQLStream(qt.CollectionID) if err != nil { - return err - } - - stream, err := qt.chMgr.getDQLStream(collID) - if err != nil { - err = qt.chMgr.createDQLStream(collID) + err = qt.chMgr.createDQLStream(qt.CollectionID) if err != nil { qt.result.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError qt.result.Status.Reason = err.Error() return err } - stream, err = qt.chMgr.getDQLStream(collID) + stream, err = qt.chMgr.getDQLStream(qt.CollectionID) if err != nil { qt.result.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError qt.result.Status.Reason = err.Error()