From 9ddb6d139319208620f25c37e595a33a2b418e99 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 2 Aug 2024 10:31:28 +0800 Subject: [PATCH] support query db size --- source/common/src/systable.c | 3 ++- source/libs/executor/src/sysscanoperator.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 69ad286b08..82da6b1a03 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -442,7 +442,8 @@ static const SSysDbTableSchema usageSchema[] = { {.name = "level3_size", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, {.name = "s3_size",.bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, {.name = "estimated_row_data_size", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, - {.name = "total size", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, + {.name = "total_size", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, + {.name = "timeseries", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, }; static const SSysTableMeta infosMeta[] = { diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 6c5871e62b..835e1794ee 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -1956,6 +1956,11 @@ static SSDataBlock* sysTableBuildVgUsage(SOperatorInfo* pOperator) { totalSize += walSize; + int64_t timeserial = 100000; + pColInfoData = taosArrayGet(p->pDataBlock, numOfCols++); + code = colDataSetVal(pColInfoData, numOfRows, (char*)×erial, false); // totoal size + QUERY_CHECK_CODE(code, lino, _end); + numOfRows +=1; pAPI->metaFn.closeTableMetaCursor(pInfo->pCur); pInfo->pCur = NULL;