chore: optimize of report time series by quantity
This commit is contained in:
parent
8e20740622
commit
1a34cd1020
|
@ -288,6 +288,7 @@ typedef struct {
|
|||
int64_t numOfSTables;
|
||||
int64_t numOfCTables;
|
||||
int64_t numOfNTables;
|
||||
int64_t numOfCmprTables;
|
||||
int64_t numOfNTimeSeries;
|
||||
int64_t numOfTimeSeries;
|
||||
int64_t itvTimeSeries;
|
||||
|
|
|
@ -354,7 +354,6 @@ struct SVStatis {
|
|||
int64_t nInsertSuccess; // delta
|
||||
int64_t nBatchInsert; // delta
|
||||
int64_t nBatchInsertSuccess; // delta
|
||||
int64_t nComparedTables;
|
||||
};
|
||||
|
||||
struct SVnodeInfo {
|
||||
|
|
|
@ -700,14 +700,15 @@ int64_t metaGetTbNum(SMeta *pMeta) {
|
|||
int64_t metaGetTimeSeriesNum(SMeta *pMeta) {
|
||||
// sum of (number of columns of stable - 1) * number of ctables (excluding timestamp column)
|
||||
int64_t nTables = metaGetTbNum(pMeta);
|
||||
if (nTables - pMeta->pVnode->statis.nComparedTables > 100 || pMeta->pVnode->config.vndStats.numOfTimeSeries <= 0 ||
|
||||
if (nTables - pMeta->pVnode->config.vndStats.numOfCmprTables > 100 ||
|
||||
pMeta->pVnode->config.vndStats.numOfTimeSeries <= 0 ||
|
||||
++pMeta->pVnode->config.vndStats.itvTimeSeries % (60 * 5) == 0) {
|
||||
int64_t num = 0;
|
||||
vnodeGetTimeSeriesNum(pMeta->pVnode, &num);
|
||||
pMeta->pVnode->config.vndStats.numOfTimeSeries = num;
|
||||
|
||||
pMeta->pVnode->config.vndStats.itvTimeSeries = (TD_VID(pMeta->pVnode) % 100) * 2;
|
||||
pMeta->pVnode->statis.nComparedTables = nTables;
|
||||
pMeta->pVnode->config.vndStats.numOfCmprTables = nTables;
|
||||
}
|
||||
|
||||
return pMeta->pVnode->config.vndStats.numOfTimeSeries + pMeta->pVnode->config.vndStats.numOfNTimeSeries;
|
||||
|
|
Loading…
Reference in New Issue