From 95ef68bbc1c8720c3badb1f587529a34adbd89bd Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 12 Aug 2022 11:39:19 +0800 Subject: [PATCH] opti:use suid+uid->tags index to optimize time cost --- source/libs/executor/src/executil.c | 2 +- source/util/src/tarray.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index c8d607185e..eb6222f15b 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -449,7 +449,7 @@ SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray* uidLi qDebug("calculate tag block rows:%d, cost:%ld us", rows, st2-st1); end: - taosArrayDestroy(tags); + taosArrayDestroyP(tags, taosMemoryFree); taosHashCleanup(ctx.colHash); taosArrayDestroy(ctx.cInfoList); blockDataDestroy(pResBlock); diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index 3c4a0a20bd..454739348e 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -386,6 +386,7 @@ void* taosArrayDestroy(SArray* pArray) { } void taosArrayDestroyP(SArray* pArray, FDelete fp) { + if(!pArray) return; for (int32_t i = 0; i < pArray->size; i++) { fp(*(void**)TARRAY_GET_ELEM(pArray, i)); } -- GitLab