From e03e4540d000419c63e7c80e11a0db8a97456dbd Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 16 Dec 2021 10:46:32 +0800 Subject: [PATCH] [TS-881] reduce tdigest pre-malloc memory from 12k to 9k for each group,same as old 8k --- src/query/inc/tdigest.h | 2 +- src/query/src/queryMain.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/query/inc/tdigest.h b/src/query/inc/tdigest.h index 625311eaab..f9b615318f 100644 --- a/src/query/inc/tdigest.h +++ b/src/query/inc/tdigest.h @@ -29,7 +29,7 @@ #define DOUBLE_MAX 1.79e+308 #define ADDITION_CENTROID_NUM 2 -#define COMPRESSION 400 +#define COMPRESSION 300 #define GET_CENTROID(compression) (ceil(compression * M_PI / 2) + 1 + ADDITION_CENTROID_NUM) #define GET_THRESHOLD(compression) (7.5 + 0.37 * compression - 2e-4 * pow(compression, 2)) #define TDIGEST_SIZE(compression) (sizeof(TDigest) + sizeof(SCentroid)*GET_CENTROID(compression) + sizeof(SPt)*GET_THRESHOLD(compression)) diff --git a/src/query/src/queryMain.c b/src/query/src/queryMain.c index fce7f64989..9bdb0efc4d 100644 --- a/src/query/src/queryMain.c +++ b/src/query/src/queryMain.c @@ -279,6 +279,8 @@ bool qTableQuery(qinfo_t qinfo, uint64_t *qId) { if (isQueryKilled(pQInfo)) { qDebug("QInfo:0x%"PRIx64" it is already killed, abort", pQInfo->qId); + setQueryKilled(pQInfo); + pQInfo->runtimeEnv.outputBuf = NULL; return doBuildResCheck(pQInfo); } -- GitLab