[td-2895] merge develop.
This commit is contained in:
parent
66163f96af
commit
8a45eedda7
|
@ -3106,30 +3106,6 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) {
|
|||
}
|
||||
}
|
||||
|
||||
static UNUSED_FUNC void transferNcharData(SSqlObj *pSql, int32_t columnIndex, TAOS_FIELD *pField) {
|
||||
SSqlRes *pRes = &pSql->res;
|
||||
|
||||
if (pRes->tsrow[columnIndex] != NULL && pField->type == TSDB_DATA_TYPE_NCHAR) {
|
||||
// convert unicode to native code in a temporary buffer extra one byte for terminated symbol
|
||||
if (pRes->buffer[columnIndex] == NULL) {
|
||||
pRes->buffer[columnIndex] = malloc(pField->bytes + TSDB_NCHAR_SIZE);
|
||||
}
|
||||
|
||||
/* string terminated char for binary data*/
|
||||
memset(pRes->buffer[columnIndex], 0, pField->bytes + TSDB_NCHAR_SIZE);
|
||||
|
||||
int32_t length = taosUcs4ToMbs(pRes->tsrow[columnIndex], pRes->length[columnIndex], pRes->buffer[columnIndex]);
|
||||
if ( length >= 0 ) {
|
||||
pRes->tsrow[columnIndex] = (unsigned char*)pRes->buffer[columnIndex];
|
||||
pRes->length[columnIndex] = length;
|
||||
} else {
|
||||
tscError("%p charset:%s to %s. val:%s convert failed.", pSql, DEFAULT_UNICODE_ENCODEC, tsCharset, (char*)pRes->tsrow[columnIndex]);
|
||||
pRes->tsrow[columnIndex] = NULL;
|
||||
pRes->length[columnIndex] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char *getArithmeticInputSrc(void *param, const char *name, int32_t colId) {
|
||||
SArithmeticSupport *pSupport = (SArithmeticSupport *) param;
|
||||
|
||||
|
|
|
@ -249,7 +249,7 @@ int32_t* taosGetErrno();
|
|||
#define TSDB_CODE_QRY_IN_EXEC TAOS_DEF_ERROR_CODE(0, 0x0709) //"Multiple retrieval of this query")
|
||||
#define TSDB_CODE_QRY_TOO_MANY_TIMEWINDOW TAOS_DEF_ERROR_CODE(0, 0x070A) //"Too many time window in query")
|
||||
#define TSDB_CODE_QRY_NOT_ENOUGH_BUFFER TAOS_DEF_ERROR_CODE(0, 0x070B) //"Query buffer limit has reached")
|
||||
#define TSDB_CODE_QRY_INCONSISTAN TAOS_DEF_ERROR_CODE(0, 0x070C) //"File inconsistance in replica")
|
||||
#define TSDB_CODE_QRY_INCONSISTAN TAOS_DEF_ERROR_CODE(0, 0x070C) //"File inconsistency in replica")
|
||||
|
||||
|
||||
// grant
|
||||
|
|
|
@ -158,13 +158,18 @@ int32_t tsdbInsertData(STsdbRepo *repo, SSubmitMsg *pMsg, SShellSubmitRspMsg *pR
|
|||
|
||||
typedef void *TsdbQueryHandleT; // Use void to hide implementation details
|
||||
|
||||
// query condition to build vnode iterator
|
||||
#define BLOCK_LOAD_OFFSET_SEQ_ORDER 1
|
||||
#define BLOCK_LOAD_TABLE_SEQ_ORDER 2
|
||||
#define BLOCK_LOAD_TABLE_RR_ORDER 3
|
||||
|
||||
// query condition to build multi-table data block iterator
|
||||
typedef struct STsdbQueryCond {
|
||||
STimeWindow twindow;
|
||||
int32_t order; // desc|asc order to iterate the data block
|
||||
int32_t numOfCols;
|
||||
SColumnInfo *colList;
|
||||
bool loadExternalRows; // load external rows or not
|
||||
int32_t type; // data block load type:
|
||||
} STsdbQueryCond;
|
||||
|
||||
typedef struct SMemRef {
|
||||
|
@ -266,17 +271,7 @@ int64_t tsdbGetNumOfRowsInMemTable(TsdbQueryHandleT* pHandle);
|
|||
* @param pQueryHandle
|
||||
* @return
|
||||
*/
|
||||
bool tsdbNextDataBlock(TsdbQueryHandleT *pQueryHandle);
|
||||
|
||||
/**
|
||||
* move to next block if exists but not merge data in memtable
|
||||
*
|
||||
* @param pQueryHandle
|
||||
* @return
|
||||
*/
|
||||
bool tsdbNextDataBlockWithoutMerge(TsdbQueryHandleT *pQueryHandle);
|
||||
|
||||
SArray* tsdbGetExternalRow(TsdbQueryHandleT *pHandle, SDataBlockInfo* blockInfo);
|
||||
bool tsdbNextDataBlock(TsdbQueryHandleT pQueryHandle);
|
||||
|
||||
/**
|
||||
* Get current data block information
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -161,7 +161,7 @@ static bool isFixedOutputQuery(SQuery* pQuery);
|
|||
|
||||
static SOperatorInfo* createDataBlocksOptScanInfo(void* pTsdbQueryHandle, SQueryRuntimeEnv* pRuntimeEnv, int32_t repeatTime, int32_t reverseTime);
|
||||
static SOperatorInfo* createTableScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv* pRuntimeEnv, int32_t repeatTime);
|
||||
static SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv* pRuntimeEnv, bool loadExternalRows);
|
||||
static SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv* pRuntimeEnv);
|
||||
|
||||
static SOperatorInfo* createAggregateOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput);
|
||||
static SOperatorInfo* createArithOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput);
|
||||
|
@ -227,47 +227,6 @@ static void* destroyOutputBuf(SSDataBlock* pBlock) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool doFilterData(SQuery *pQuery, int32_t elemPos) {
|
||||
for (int32_t k = 0; k < pQuery->numOfFilterCols; ++k) {
|
||||
SSingleColumnFilterInfo *pFilterInfo = &pQuery->pFilterInfo[k];
|
||||
|
||||
char *pElem = (char*)pFilterInfo->pData + pFilterInfo->info.bytes * elemPos;
|
||||
|
||||
bool qualified = false;
|
||||
for (int32_t j = 0; j < pFilterInfo->numOfFilters; ++j) {
|
||||
SColumnFilterElem *pFilterElem = &pFilterInfo->pFilters[j];
|
||||
|
||||
bool isnull = isNull(pElem, pFilterInfo->info.type);
|
||||
if (isnull) {
|
||||
if (pFilterElem->fp == isNullOperator) {
|
||||
qualified = true;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (pFilterElem->fp == notNullOperator) {
|
||||
qualified = true;
|
||||
break;
|
||||
} else if (pFilterElem->fp == isNullOperator) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (pFilterElem->fp(pFilterElem, pElem, pElem, pFilterInfo->info.type)) {
|
||||
qualified = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!qualified) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int64_t getNumOfResult(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx* pCtx, int32_t numOfOutput) {
|
||||
SQuery *pQuery = pRuntimeEnv->pQuery;
|
||||
bool hasMainFunction = hasMainOutput(pQuery);
|
||||
|
@ -2448,21 +2407,23 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa
|
|||
SQInfo* pQInfo = pRuntimeEnv->qinfo;
|
||||
SQueryCostInfo* pCost = &pQInfo->summary;
|
||||
|
||||
if (pRuntimeEnv->pTsBuf != NULL && pQuery->stableQuery) {
|
||||
SExprInfo* pExprInfo = &pTableScanInfo->pExpr[0];
|
||||
int16_t tagId = (int16_t)pExprInfo->base.arg->argValue.i64;
|
||||
SColumnInfo* pColInfo = doGetTagColumnInfoById(pQuery->tagColList, pQuery->numOfTags, tagId);
|
||||
if (pRuntimeEnv->pTsBuf != NULL) {
|
||||
*status = BLK_DATA_ALL_NEEDED;
|
||||
|
||||
// compare tag first
|
||||
tVariant t = {0};
|
||||
doSetTagValueInParam(pQuery->current->pTable, tagId, &t, pColInfo->type, pColInfo->bytes);
|
||||
if (pQuery->stableQuery) {
|
||||
SExprInfo* pExprInfo = &pTableScanInfo->pExpr[0];
|
||||
int16_t tagId = (int16_t)pExprInfo->base.arg->argValue.i64;
|
||||
SColumnInfo* pColInfo = doGetTagColumnInfoById(pQuery->tagColList, pQuery->numOfTags, tagId);
|
||||
|
||||
STSElem elem = tsBufGetElem(pRuntimeEnv->pTsBuf);
|
||||
if (tsBufIsValidElem(&elem) && tVariantCompare(&t, elem.tag) == 0) {
|
||||
*status = BLK_DATA_ALL_NEEDED;
|
||||
} else {
|
||||
(*status) = BLK_DATA_DISCARD;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
// compare tag first
|
||||
tVariant t = {0};
|
||||
doSetTagValueInParam(pQuery->current->pTable, tagId, &t, pColInfo->type, pColInfo->bytes);
|
||||
|
||||
STSElem elem = tsBufGetElem(pRuntimeEnv->pTsBuf);
|
||||
if (!tsBufIsValidElem(&elem) || (tsBufIsValidElem(&elem) && (tVariantCompare(&t, elem.tag) != 0))) {
|
||||
(*status) = BLK_DATA_DISCARD;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3870,7 +3831,7 @@ static int compareBlockInfo(const void *pLeft, const void *pRight) {
|
|||
|
||||
static void doDestroyTableQueryInfo(STableGroupInfo* pTableqinfoGroupInfo);
|
||||
|
||||
static void setTableQueryHandle(SQueryRuntimeEnv* pRuntimeEnv, int32_t tableIndex) {
|
||||
static UNUSED_FUNC void setTableQueryHandle(SQueryRuntimeEnv* pRuntimeEnv, int32_t tableIndex) {
|
||||
SQuery* pQuery = pRuntimeEnv->pQuery;
|
||||
|
||||
int32_t numOfGroup = GET_NUM_OF_TABLEGROUP(pRuntimeEnv);
|
||||
|
@ -3920,12 +3881,15 @@ static int32_t setupQueryHandle(void* tsdb, SQInfo* pQInfo, bool isSTableQuery)
|
|||
// TODO set the tags scan handle
|
||||
if (onlyQueryTags(pQuery)) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
} else if (isTsCompQuery(pQuery)) {
|
||||
setTableQueryHandle(pRuntimeEnv, 0);
|
||||
return terrno;
|
||||
// } else if (isTsCompQuery(pQuery)) {
|
||||
// setTableQueryHandle(pRuntimeEnv, 0);
|
||||
// return terrno;
|
||||
}
|
||||
|
||||
STsdbQueryCond cond = createTsdbQueryCond(pQuery, &pQuery->window);
|
||||
if (isTsCompQuery(pQuery) || isPointInterpoQuery(pQuery)) {
|
||||
cond.type = BLOCK_LOAD_TABLE_SEQ_ORDER;
|
||||
}
|
||||
|
||||
if (!isSTableQuery
|
||||
&& (pRuntimeEnv->tableqinfoGroupInfo.numOfTables == 1)
|
||||
|
@ -4034,7 +3998,7 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, SArray* prevResult, void *ts
|
|||
} else if (pQuery->queryBlockDist) {
|
||||
pRuntimeEnv->pTableScanner = createTableBlockInfoScanOperator(pRuntimeEnv->pQueryHandle, pRuntimeEnv);
|
||||
} else if (isTsCompQuery(pQuery) || isPointInterpoQuery(pQuery)) {
|
||||
pRuntimeEnv->pTableScanner = createTableSeqScanOperator(pRuntimeEnv->pQueryHandle, pRuntimeEnv, isPointInterpoQuery(pQuery));
|
||||
pRuntimeEnv->pTableScanner = createTableSeqScanOperator(pRuntimeEnv->pQueryHandle, pRuntimeEnv);
|
||||
} else if (needReverseScan(pQuery)) {
|
||||
pRuntimeEnv->pTableScanner = createDataBlocksOptScanInfo(pRuntimeEnv->pQueryHandle, pRuntimeEnv, getNumOfScanTimes(pQuery), 1);
|
||||
} else {
|
||||
|
@ -4095,6 +4059,7 @@ STsdbQueryCond createTsdbQueryCond(SQuery* pQuery, STimeWindow* win) {
|
|||
.colList = pQuery->colList,
|
||||
.order = pQuery->order.order,
|
||||
.numOfCols = pQuery->numOfCols,
|
||||
.type = BLOCK_LOAD_OFFSET_SEQ_ORDER,
|
||||
.loadExternalRows = false,
|
||||
};
|
||||
|
||||
|
@ -4173,27 +4138,9 @@ static SSDataBlock* doTableScanImpl(STableScanInfo *pTableScanInfo) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (pTableScanInfo->loadExternalRows) {
|
||||
pTableScanInfo->externalLoaded = true;
|
||||
}
|
||||
|
||||
return pBlock;
|
||||
}
|
||||
|
||||
if (pTableScanInfo->loadExternalRows && (!pTableScanInfo->externalLoaded)) {
|
||||
pBlock->pDataBlock = tsdbGetExternalRow(pTableScanInfo->pQueryHandle, &pBlock->info);
|
||||
pTableScanInfo->externalLoaded = true;
|
||||
|
||||
if (pBlock->pDataBlock != NULL) {
|
||||
STableQueryInfo** pTableQueryInfo =
|
||||
(STableQueryInfo**)taosHashGet(pTableGroupInfo->map, &pBlock->info.tid, sizeof(pBlock->info.tid));
|
||||
assert(*pTableQueryInfo != NULL);
|
||||
pQuery->current = *pTableQueryInfo;
|
||||
}
|
||||
|
||||
return (pBlock->pDataBlock != NULL)? pBlock:NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -4273,25 +4220,26 @@ static SSDataBlock* doSeqTableBlocksScan(void* param) {
|
|||
SOperatorInfo* pOperator = (SOperatorInfo*)param;
|
||||
|
||||
STableScanInfo *pTableScanInfo = pOperator->info;
|
||||
SQueryRuntimeEnv *pRuntimeEnv = pTableScanInfo->pRuntimeEnv;
|
||||
// SQueryRuntimeEnv *pRuntimeEnv = pTableScanInfo->pRuntimeEnv;
|
||||
|
||||
int32_t totalTables = pRuntimeEnv->tableqinfoGroupInfo.numOfTables;
|
||||
// int32_t totalTables = pRuntimeEnv->tableqinfoGroupInfo.numOfTables;
|
||||
|
||||
while (1) {
|
||||
SSDataBlock* p = doTableScanImpl(pTableScanInfo);
|
||||
if (p != NULL) {
|
||||
return p;
|
||||
}
|
||||
// while (1) {
|
||||
return doTableScanImpl(pTableScanInfo);
|
||||
// SSDataBlock* p = doTableScanImpl(pTableScanInfo);
|
||||
// if (p != NULL) {
|
||||
// return p;
|
||||
// }
|
||||
|
||||
// try the next table
|
||||
if (++pTableScanInfo->tableIndex >= totalTables) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
setTableQueryHandle(pRuntimeEnv, pTableScanInfo->tableIndex);
|
||||
pTableScanInfo->pQueryHandle = pRuntimeEnv->pQueryHandle;
|
||||
pTableScanInfo->externalLoaded = false;
|
||||
}
|
||||
// if (++pTableScanInfo->tableIndex >= totalTables) {
|
||||
// return NULL;
|
||||
// }
|
||||
//
|
||||
// setTableQueryHandle(pRuntimeEnv, pTableScanInfo->tableIndex);
|
||||
// pTableScanInfo->pQueryHandle = pRuntimeEnv->pQueryHandle;
|
||||
// pTableScanInfo->externalLoaded = false;
|
||||
// }
|
||||
}
|
||||
|
||||
static SSDataBlock* doBlockInfoScan(void* param) {
|
||||
|
@ -4354,7 +4302,7 @@ SOperatorInfo* createTableScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv*
|
|||
return pOperator;
|
||||
}
|
||||
|
||||
SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv* pRuntimeEnv, bool loadExternalRows) {
|
||||
SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv* pRuntimeEnv) {
|
||||
STableScanInfo* pInfo = calloc(1, sizeof(STableScanInfo));
|
||||
|
||||
pInfo->pQueryHandle = pTsdbQueryHandle;
|
||||
|
@ -4363,7 +4311,6 @@ SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeE
|
|||
pInfo->order = pRuntimeEnv->pQuery->order.order;
|
||||
pInfo->current = 0;
|
||||
pInfo->pRuntimeEnv = pRuntimeEnv;
|
||||
pInfo->loadExternalRows = loadExternalRows;
|
||||
|
||||
SOperatorInfo* pOperator = calloc(1, sizeof(SOperatorInfo));
|
||||
pOperator->name = "TableSeqScanOperator";
|
||||
|
|
|
@ -34,11 +34,9 @@
|
|||
.tid = (_checkInfo)->tableId.tid, \
|
||||
.uid = (_checkInfo)->tableId.uid})
|
||||
|
||||
|
||||
enum {
|
||||
TSDB_QUERY_TYPE_ALL = 1,
|
||||
TSDB_QUERY_TYPE_LAST = 2,
|
||||
TSDB_QUERY_TYPE_EXTERNAL = 3,
|
||||
};
|
||||
|
||||
typedef struct SQueryFilePos {
|
||||
|
@ -68,7 +66,7 @@ typedef struct STableCheckInfo {
|
|||
STableId tableId;
|
||||
TSKEY lastKey;
|
||||
STable* pTableObj;
|
||||
SBlockInfo* pCompInfo;
|
||||
SBlockInfo* pCompInfo;
|
||||
int32_t compSize;
|
||||
int32_t numOfBlocks:29; // number of qualified data blocks not the original blocks
|
||||
int8_t chosen:2; // indicate which iterator should move forward
|
||||
|
@ -111,6 +109,8 @@ typedef struct STsdbQueryHandle {
|
|||
bool checkFiles; // check file stage
|
||||
bool cachelastrow; // check if last row cached
|
||||
bool loadExternalRow; // load time window external data rows
|
||||
bool currentLoadExternalRows; // current load external rows
|
||||
int32_t loadType; // block load type
|
||||
void* qinfo; // query info handle, for debug purpose
|
||||
int32_t type; // query type: retrieve all data blocks, 2. retrieve only last row, 3. retrieve direct prev|next rows
|
||||
SDFileSet* pFileGroup;
|
||||
|
@ -147,6 +147,8 @@ static int32_t tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey,
|
|||
static int32_t tsdbCheckInfoCompar(const void* key1, const void* key2);
|
||||
static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SMemRef* pMemRef);
|
||||
static void* doFreeColumnInfoData(SArray* pColumnInfoData);
|
||||
static void* destroyTableCheckInfo(SArray* pTableCheckInfo);
|
||||
static bool tsdbGetExternalRow(TsdbQueryHandleT pHandle);
|
||||
|
||||
static void tsdbInitDataBlockLoadInfo(SDataBlockLoadInfo* pBlockLoadInfo) {
|
||||
pBlockLoadInfo->slot = -1;
|
||||
|
@ -297,12 +299,10 @@ static SArray* createCheckInfoFromTableGroup(STsdbQueryHandle* pQueryHandle, STa
|
|||
|
||||
for (int32_t i = 0; i < gsize; ++i) {
|
||||
STableCheckInfo* pInfo = (STableCheckInfo*) taosArrayGet(pTableCheckInfo, i);
|
||||
|
||||
taosArrayPush(pTable, &pInfo->pTableObj);
|
||||
}
|
||||
|
||||
*psTable = pTable;
|
||||
|
||||
return pTableCheckInfo;
|
||||
}
|
||||
|
||||
|
@ -326,28 +326,18 @@ static void resetCheckInfo(STsdbQueryHandle* pQueryHandle) {
|
|||
}
|
||||
}
|
||||
|
||||
static SArray* createCheckInfoFromCheckInfo(SArray* pTableCheckInfo, TSKEY skey, SArray** psTable) {
|
||||
size_t si = taosArrayGetSize(pTableCheckInfo);
|
||||
SArray* pNew = taosArrayInit(si, sizeof(STableCheckInfo));
|
||||
if (pNew == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
// only one table, not need to sort again
|
||||
static SArray* createCheckInfoFromCheckInfo(STableCheckInfo* pCheckInfo, TSKEY skey, SArray** psTable) {
|
||||
SArray* pNew = taosArrayInit(1, sizeof(STableCheckInfo));
|
||||
SArray* pTable = taosArrayInit(1, sizeof(STable*));
|
||||
|
||||
SArray* pTable = taosArrayInit(si, sizeof(STable*));
|
||||
STableCheckInfo info = { .lastKey = skey, .pTableObj = pCheckInfo->pTableObj};
|
||||
|
||||
for (int32_t j = 0; j < si; ++j) {
|
||||
STableCheckInfo* pCheckInfo = (STableCheckInfo*) taosArrayGet(pTableCheckInfo, j);
|
||||
STableCheckInfo info = { .lastKey = skey, .pTableObj = pCheckInfo->pTableObj};
|
||||
|
||||
info.tableId = pCheckInfo->tableId;
|
||||
taosArrayPush(pNew, &info);
|
||||
taosArrayPush(pTable, &pCheckInfo->pTableObj);
|
||||
}
|
||||
info.tableId = pCheckInfo->tableId;
|
||||
taosArrayPush(pNew, &info);
|
||||
taosArrayPush(pTable, &pCheckInfo->pTableObj);
|
||||
|
||||
*psTable = pTable;
|
||||
|
||||
// it is ordered already, no need to sort again.
|
||||
taosArraySort(pNew, tsdbCheckInfoCompar);
|
||||
return pNew;
|
||||
}
|
||||
|
||||
|
@ -371,14 +361,15 @@ static STsdbQueryHandle* tsdbQueryTablesImpl(STsdbRepo* tsdb, STsdbQueryCond* pC
|
|||
pQueryHandle->locateStart = false;
|
||||
pQueryHandle->pMemRef = pMemRef;
|
||||
pQueryHandle->loadExternalRow = pCond->loadExternalRows;
|
||||
pQueryHandle->currentLoadExternalRows = pCond->loadExternalRows;
|
||||
|
||||
pQueryHandle->loadType = pCond->type;
|
||||
|
||||
if (tsdbInitReadH(&pQueryHandle->rhelper, (STsdbRepo*)tsdb) != 0) {
|
||||
goto out_of_memory;
|
||||
}
|
||||
|
||||
//tsdbMayTakeMemSnapshot(pQueryHandle);
|
||||
assert(pCond != NULL && pCond->numOfCols > 0 && pMemRef != NULL);
|
||||
|
||||
if (ASCENDING_TRAVERSE(pCond->order)) {
|
||||
assert(pQueryHandle->window.skey <= pQueryHandle->window.ekey);
|
||||
} else {
|
||||
|
@ -510,6 +501,9 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon
|
|||
|
||||
SArray* pTable = NULL;
|
||||
STsdbMeta* pMeta = tsdbGetMeta(pQueryHandle->pTsdb);
|
||||
|
||||
pQueryHandle->pTableCheckInfo = destroyTableCheckInfo(pQueryHandle->pTableCheckInfo);
|
||||
|
||||
pQueryHandle->pTableCheckInfo = createCheckInfoFromTableGroup(pQueryHandle, groupList, pMeta, &pTable);
|
||||
if (pQueryHandle->pTableCheckInfo == NULL) {
|
||||
tsdbCleanupQueryHandle(pQueryHandle);
|
||||
|
@ -556,13 +550,46 @@ SArray* tsdbGetQueriedTableList(TsdbQueryHandleT *pHandle) {
|
|||
return res;
|
||||
}
|
||||
|
||||
TsdbQueryHandleT tsdbQueryRowsInExternalWindow(STsdbRepo *tsdb, STsdbQueryCond* pCond, STableGroupInfo *groupList, void* qinfo, SMemRef* pRef) {
|
||||
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList, qinfo, pRef);
|
||||
pQueryHandle->loadExternalRow = true;
|
||||
if (pQueryHandle != NULL) {
|
||||
changeQueryHandleForInterpQuery(pQueryHandle);
|
||||
// leave only one table for each group
|
||||
static STableGroupInfo* trimTableGroup(STimeWindow* window, STableGroupInfo* pGroupList) {
|
||||
assert(pGroupList);
|
||||
size_t numOfGroup = taosArrayGetSize(pGroupList->pGroupList);
|
||||
|
||||
STableGroupInfo* pNew = calloc(1, sizeof(STableGroupInfo));
|
||||
pNew->pGroupList = taosArrayInit(numOfGroup, sizeof(SArray));
|
||||
|
||||
for(int32_t i = 0; i < numOfGroup; ++i) {
|
||||
SArray* oneGroup = taosArrayGetP(pGroupList->pGroupList, i);
|
||||
size_t numOfTables = taosArrayGetSize(oneGroup);
|
||||
|
||||
SArray* px = taosArrayInit(4, sizeof(STableKeyInfo));
|
||||
for (int32_t j = 0; j < numOfTables; ++j) {
|
||||
STableKeyInfo* pInfo = (STableKeyInfo*)taosArrayGet(oneGroup, j);
|
||||
if (window->skey <= pInfo->lastKey && ((STable*)pInfo->pTable)->lastKey != TSKEY_INITIAL_VAL) {
|
||||
taosArrayPush(px, pInfo);
|
||||
pNew->numOfTables += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// there are no data in this group
|
||||
if (taosArrayGetSize(px) == 0) {
|
||||
taosArrayDestroy(px);
|
||||
} else {
|
||||
taosArrayPush(pNew->pGroupList, &px);
|
||||
}
|
||||
}
|
||||
|
||||
return pNew;
|
||||
}
|
||||
|
||||
TsdbQueryHandleT tsdbQueryRowsInExternalWindow(STsdbRepo *tsdb, STsdbQueryCond* pCond, STableGroupInfo *groupList, void* qinfo, SMemRef* pRef) {
|
||||
STableGroupInfo* pNew = trimTableGroup(&pCond->twindow, groupList);
|
||||
|
||||
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, pNew, qinfo, pRef);
|
||||
pQueryHandle->loadExternalRow = true;
|
||||
pQueryHandle->currentLoadExternalRows = true;
|
||||
|
||||
return pQueryHandle;
|
||||
}
|
||||
|
||||
|
@ -856,77 +883,94 @@ static int32_t binarySearchForBlock(SBlock* pBlock, int32_t numOfBlocks, TSKEY s
|
|||
return midSlot;
|
||||
}
|
||||
|
||||
static int32_t loadBlockInfo(STsdbQueryHandle * pQueryHandle, int32_t index, int32_t* numOfBlocks) {
|
||||
int32_t code = 0;
|
||||
|
||||
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, index);
|
||||
pCheckInfo->numOfBlocks = 0;
|
||||
|
||||
if (tsdbSetReadTable(&pQueryHandle->rhelper, pCheckInfo->pTableObj) != TSDB_CODE_SUCCESS) {
|
||||
code = terrno;
|
||||
return code;
|
||||
}
|
||||
|
||||
SBlockIdx* compIndex = pQueryHandle->rhelper.pBlkIdx;
|
||||
|
||||
// no data block in this file, try next file
|
||||
if (compIndex == NULL || compIndex->uid != pCheckInfo->tableId.uid) {
|
||||
return 0; // no data blocks in the file belongs to pCheckInfo->pTable
|
||||
}
|
||||
|
||||
if (pCheckInfo->compSize < (int32_t)compIndex->len) {
|
||||
assert(compIndex->len > 0);
|
||||
|
||||
char* t = realloc(pCheckInfo->pCompInfo, compIndex->len);
|
||||
if (t == NULL) {
|
||||
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
code = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
return code;
|
||||
}
|
||||
|
||||
pCheckInfo->pCompInfo = (SBlockInfo*)t;
|
||||
pCheckInfo->compSize = compIndex->len;
|
||||
}
|
||||
|
||||
tsdbLoadBlockInfo(&(pQueryHandle->rhelper), (void*)(pCheckInfo->pCompInfo));
|
||||
SBlockInfo* pCompInfo = pCheckInfo->pCompInfo;
|
||||
|
||||
TSKEY s = TSKEY_INITIAL_VAL, e = TSKEY_INITIAL_VAL;
|
||||
|
||||
if (ASCENDING_TRAVERSE(pQueryHandle->order)) {
|
||||
assert(pCheckInfo->lastKey <= pQueryHandle->window.ekey && pQueryHandle->window.skey <= pQueryHandle->window.ekey);
|
||||
} else {
|
||||
assert(pCheckInfo->lastKey >= pQueryHandle->window.ekey && pQueryHandle->window.skey >= pQueryHandle->window.ekey);
|
||||
}
|
||||
|
||||
s = MIN(pCheckInfo->lastKey, pQueryHandle->window.ekey);
|
||||
e = MAX(pCheckInfo->lastKey, pQueryHandle->window.ekey);
|
||||
|
||||
// discard the unqualified data block based on the query time window
|
||||
int32_t start = binarySearchForBlock(pCompInfo->blocks, compIndex->numOfBlocks, s, TSDB_ORDER_ASC);
|
||||
int32_t end = start;
|
||||
|
||||
if (s > pCompInfo->blocks[start].keyLast) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// todo speedup the procedure of located end block
|
||||
while (end < (int32_t)compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) {
|
||||
end += 1;
|
||||
}
|
||||
|
||||
pCheckInfo->numOfBlocks = (end - start);
|
||||
|
||||
if (start > 0) {
|
||||
memmove(pCompInfo->blocks, &pCompInfo->blocks[start], pCheckInfo->numOfBlocks * sizeof(SBlock));
|
||||
}
|
||||
|
||||
(*numOfBlocks) += pCheckInfo->numOfBlocks;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlocks) {
|
||||
// load all the comp offset value for all tables in this file
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
|
||||
*numOfBlocks = 0;
|
||||
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||
|
||||
for (int32_t i = 0; i < numOfTables; ++i) {
|
||||
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i);
|
||||
pCheckInfo->numOfBlocks = 0;
|
||||
size_t numOfTables = 0;
|
||||
if (pQueryHandle->loadType == BLOCK_LOAD_TABLE_SEQ_ORDER) {
|
||||
code = loadBlockInfo(pQueryHandle, pQueryHandle->activeIndex, numOfBlocks);
|
||||
} else if (pQueryHandle->loadType == BLOCK_LOAD_OFFSET_SEQ_ORDER) {
|
||||
numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||
|
||||
if (tsdbSetReadTable(&pQueryHandle->rhelper, pCheckInfo->pTableObj) != TSDB_CODE_SUCCESS) {
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
|
||||
SBlockIdx* compIndex = pQueryHandle->rhelper.pBlkIdx;
|
||||
|
||||
// no data block in this file, try next file
|
||||
if (compIndex == NULL || compIndex->uid != pCheckInfo->tableId.uid) {
|
||||
continue; // no data blocks in the file belongs to pCheckInfo->pTable
|
||||
}
|
||||
|
||||
if (pCheckInfo->compSize < (int32_t)compIndex->len) {
|
||||
assert(compIndex->len > 0);
|
||||
|
||||
char* t = realloc(pCheckInfo->pCompInfo, compIndex->len);
|
||||
if (t == NULL) {
|
||||
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
code = TSDB_CODE_TDB_OUT_OF_MEMORY;
|
||||
break;
|
||||
for (int32_t i = 0; i < numOfTables; ++i) {
|
||||
code = loadBlockInfo(pQueryHandle, i, numOfBlocks);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
||||
pCheckInfo->pCompInfo = (SBlockInfo*) t;
|
||||
pCheckInfo->compSize = compIndex->len;
|
||||
}
|
||||
|
||||
tsdbLoadBlockInfo(&(pQueryHandle->rhelper), (void *)(pCheckInfo->pCompInfo));
|
||||
SBlockInfo* pCompInfo = pCheckInfo->pCompInfo;
|
||||
|
||||
TSKEY s = TSKEY_INITIAL_VAL, e = TSKEY_INITIAL_VAL;
|
||||
|
||||
if (ASCENDING_TRAVERSE(pQueryHandle->order)) {
|
||||
assert(pCheckInfo->lastKey <= pQueryHandle->window.ekey && pQueryHandle->window.skey <= pQueryHandle->window.ekey);
|
||||
} else {
|
||||
assert(pCheckInfo->lastKey >= pQueryHandle->window.ekey && pQueryHandle->window.skey >= pQueryHandle->window.ekey);
|
||||
}
|
||||
|
||||
s = MIN(pCheckInfo->lastKey, pQueryHandle->window.ekey);
|
||||
e = MAX(pCheckInfo->lastKey, pQueryHandle->window.ekey);
|
||||
|
||||
// discard the unqualified data block based on the query time window
|
||||
int32_t start = binarySearchForBlock(pCompInfo->blocks, compIndex->numOfBlocks, s, TSDB_ORDER_ASC);
|
||||
int32_t end = start;
|
||||
|
||||
if (s > pCompInfo->blocks[start].keyLast) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// todo speedup the procedure of located end block
|
||||
while (end < (int32_t)compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) {
|
||||
end += 1;
|
||||
}
|
||||
|
||||
pCheckInfo->numOfBlocks = (end - start);
|
||||
|
||||
if (start > 0) {
|
||||
memmove(pCompInfo->blocks, &pCompInfo->blocks[start], pCheckInfo->numOfBlocks * sizeof(SBlock));
|
||||
}
|
||||
|
||||
(*numOfBlocks) += pCheckInfo->numOfBlocks;
|
||||
} else {
|
||||
assert(0);
|
||||
}
|
||||
|
||||
return code;
|
||||
|
@ -1817,6 +1861,7 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO
|
|||
memset(pQueryHandle->pDataBlockInfo, 0, size);
|
||||
*numOfAllocBlocks = numOfBlocks;
|
||||
|
||||
// access data blocks according to the offset of each block in asc/desc order.
|
||||
int32_t numOfTables = (int32_t)taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||
|
||||
SBlockOrderSupporter sup = {0};
|
||||
|
@ -2189,12 +2234,6 @@ static bool doHasDataInBuffer(STsdbQueryHandle* pQueryHandle) {
|
|||
pQueryHandle->activeIndex += 1;
|
||||
}
|
||||
|
||||
if (pQueryHandle->loadExternalRow && pQueryHandle->window.skey == pQueryHandle->window.ekey) {
|
||||
SMemRef* pMemRef = pQueryHandle->pMemRef;
|
||||
doGetExternalRow(pQueryHandle, TSDB_PREV_ROW, pMemRef);
|
||||
doGetExternalRow(pQueryHandle, TSDB_NEXT_ROW, pMemRef);
|
||||
}
|
||||
|
||||
// no data in memtable or imemtable, decrease the memory reference.
|
||||
// TODO !!
|
||||
// tsdbMayUnTakeMemSnapshot(pQueryHandle);
|
||||
|
@ -2202,7 +2241,7 @@ static bool doHasDataInBuffer(STsdbQueryHandle* pQueryHandle) {
|
|||
}
|
||||
|
||||
//todo not unref yet, since it is not support multi-group interpolation query
|
||||
static void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle) {
|
||||
static UNUSED_FUNC void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle) {
|
||||
// filter the queried time stamp in the first place
|
||||
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*) pHandle;
|
||||
|
||||
|
@ -2325,114 +2364,164 @@ static void destroyHelper(void* param) {
|
|||
free(param);
|
||||
}
|
||||
|
||||
// handle data in cache situation
|
||||
bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
|
||||
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*) pHandle;
|
||||
static bool loadBlockOfActiveTable(STsdbQueryHandle* pQueryHandle) {
|
||||
if (pQueryHandle->checkFiles) {
|
||||
// check if the query range overlaps with the file data block
|
||||
bool exists = true;
|
||||
|
||||
int64_t stime = taosGetTimestampUs();
|
||||
int64_t elapsedTime = stime;
|
||||
int32_t code = getDataBlocksInFiles(pQueryHandle, &exists);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
pQueryHandle->checkFiles = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exists) {
|
||||
if (pQueryHandle->currentLoadExternalRows && pQueryHandle->window.skey == pQueryHandle->window.ekey) {
|
||||
SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, 0);
|
||||
assert(*(int64_t*)pColInfo->pData == pQueryHandle->window.skey);
|
||||
}
|
||||
|
||||
pQueryHandle->currentLoadExternalRows = false; // clear the flag, since the exact matched row is found.
|
||||
return exists;
|
||||
}
|
||||
|
||||
pQueryHandle->checkFiles = false;
|
||||
}
|
||||
|
||||
if (hasMoreDataInCache(pQueryHandle)) {
|
||||
pQueryHandle->currentLoadExternalRows = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// current result is empty
|
||||
if (pQueryHandle->currentLoadExternalRows && pQueryHandle->window.skey == pQueryHandle->window.ekey && pQueryHandle->cur.rows == 0) {
|
||||
SMemRef* pMemRef = pQueryHandle->pMemRef;
|
||||
|
||||
doGetExternalRow(pQueryHandle, TSDB_PREV_ROW, pMemRef);
|
||||
doGetExternalRow(pQueryHandle, TSDB_NEXT_ROW, pMemRef);
|
||||
|
||||
bool result = tsdbGetExternalRow(pQueryHandle);
|
||||
|
||||
pQueryHandle->prev = doFreeColumnInfoData(pQueryHandle->prev);
|
||||
pQueryHandle->next = doFreeColumnInfoData(pQueryHandle->next);
|
||||
pQueryHandle->currentLoadExternalRows = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool loadCachedLastRow(STsdbQueryHandle* pQueryHandle) {
|
||||
// the last row is cached in buffer, return it directly.
|
||||
// here note that the pQueryHandle->window must be the TS_INITIALIZER
|
||||
int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle));
|
||||
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||
assert(numOfTables > 0 && numOfCols > 0);
|
||||
|
||||
SQueryFilePos* cur = &pQueryHandle->cur;
|
||||
|
||||
SDataRow pRow = NULL;
|
||||
TSKEY key = TSKEY_INITIAL_VAL;
|
||||
int32_t step = ASCENDING_TRAVERSE(pQueryHandle->order)? 1:-1;
|
||||
|
||||
if (++pQueryHandle->activeIndex < numOfTables) {
|
||||
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, pQueryHandle->activeIndex);
|
||||
int32_t ret = tsdbGetCachedLastRow(pCheckInfo->pTableObj, &pRow, &key);
|
||||
if (ret != TSDB_CODE_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
copyOneRowFromMem(pQueryHandle, pQueryHandle->outputCapacity, 0, pRow, numOfCols, pCheckInfo->pTableObj, NULL);
|
||||
tfree(pRow);
|
||||
|
||||
// update the last key value
|
||||
pCheckInfo->lastKey = key + step;
|
||||
|
||||
cur->rows = 1; // only one row
|
||||
cur->lastKey = key + step;
|
||||
cur->mixBlock = true;
|
||||
cur->win.skey = key;
|
||||
cur->win.ekey = key;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool loadDataBlockFromTableSeq(STsdbQueryHandle* pQueryHandle) {
|
||||
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||
assert(numOfTables > 0);
|
||||
|
||||
if (pQueryHandle->type == TSDB_QUERY_TYPE_LAST && pQueryHandle->cachelastrow) {
|
||||
// the last row is cached in buffer, return it directly.
|
||||
// here note that the pQueryHandle->window must be the TS_INITIALIZER
|
||||
int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle));
|
||||
SQueryFilePos* cur = &pQueryHandle->cur;
|
||||
|
||||
SDataRow pRow = NULL;
|
||||
TSKEY key = TSKEY_INITIAL_VAL;
|
||||
int32_t step = ASCENDING_TRAVERSE(pQueryHandle->order)? 1:-1;
|
||||
|
||||
if (++pQueryHandle->activeIndex < numOfTables) {
|
||||
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, pQueryHandle->activeIndex);
|
||||
int32_t ret = tsdbGetCachedLastRow(pCheckInfo->pTableObj, &pRow, &key);
|
||||
if (ret != TSDB_CODE_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
copyOneRowFromMem(pQueryHandle, pQueryHandle->outputCapacity, 0, pRow, numOfCols, pCheckInfo->pTableObj, NULL);
|
||||
tfree(pRow);
|
||||
|
||||
// update the last key value
|
||||
pCheckInfo->lastKey = key + step;
|
||||
|
||||
cur->rows = 1; // only one row
|
||||
cur->lastKey = key + step;
|
||||
cur->mixBlock = true;
|
||||
cur->win.skey = key;
|
||||
cur->win.ekey = key;
|
||||
int64_t stime = taosGetTimestampUs();
|
||||
|
||||
while(pQueryHandle->activeIndex < numOfTables) {
|
||||
if (loadBlockOfActiveTable(pQueryHandle)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, pQueryHandle->activeIndex);
|
||||
pCheckInfo->numOfBlocks = 0;
|
||||
|
||||
pQueryHandle->activeIndex += 1;
|
||||
pQueryHandle->locateStart = false;
|
||||
pQueryHandle->checkFiles = true;
|
||||
pQueryHandle->cur.rows = 0;
|
||||
pQueryHandle->currentLoadExternalRows = pQueryHandle->loadExternalRow;
|
||||
|
||||
terrno = TSDB_CODE_SUCCESS;
|
||||
|
||||
int64_t elapsedTime = taosGetTimestampUs() - stime;
|
||||
pQueryHandle->cost.checkForNextTime += elapsedTime;
|
||||
}
|
||||
|
||||
if (pQueryHandle->checkFiles) {
|
||||
// check if the query range overlaps with the file data block
|
||||
bool exists = true;
|
||||
|
||||
int32_t code = getDataBlocksInFiles(pQueryHandle, &exists);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
pQueryHandle->activeIndex = 0;
|
||||
pQueryHandle->checkFiles = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exists) {
|
||||
pQueryHandle->cost.checkForNextTime += (taosGetTimestampUs() - stime);
|
||||
return exists;
|
||||
}
|
||||
|
||||
pQueryHandle->activeIndex = 0;
|
||||
pQueryHandle->checkFiles = false;
|
||||
}
|
||||
|
||||
// TODO: opt by consider the scan order
|
||||
bool ret = doHasDataInBuffer(pQueryHandle);
|
||||
terrno = TSDB_CODE_SUCCESS;
|
||||
|
||||
elapsedTime = taosGetTimestampUs() - stime;
|
||||
pQueryHandle->cost.checkForNextTime += elapsedTime;
|
||||
return ret;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool tsdbNextDataBlockWithoutMerge(TsdbQueryHandleT* pHandle) {
|
||||
// handle data in cache situation
|
||||
bool tsdbNextDataBlock(TsdbQueryHandleT pHandle) {
|
||||
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*) pHandle;
|
||||
|
||||
int64_t stime = taosGetTimestampUs();
|
||||
int64_t elapsedTime = stime;
|
||||
|
||||
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||
assert(numOfTables > 0);
|
||||
|
||||
if (pQueryHandle->checkFiles) {
|
||||
// check if the query range overlaps with the file data block
|
||||
bool exists = true;
|
||||
|
||||
int32_t code = getDataBlocksInFiles(pQueryHandle, &exists);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
pQueryHandle->activeIndex = 0;
|
||||
pQueryHandle->checkFiles = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exists) {
|
||||
pQueryHandle->cost.checkForNextTime += (taosGetTimestampUs() - stime);
|
||||
return exists;
|
||||
}
|
||||
|
||||
pQueryHandle->activeIndex = 0;
|
||||
pQueryHandle->checkFiles = false;
|
||||
if (pQueryHandle->type == TSDB_QUERY_TYPE_LAST && pQueryHandle->cachelastrow) {
|
||||
return loadCachedLastRow(pQueryHandle);
|
||||
}
|
||||
|
||||
elapsedTime = taosGetTimestampUs() - stime;
|
||||
pQueryHandle->cost.checkForNextTime += elapsedTime;
|
||||
return false;
|
||||
if (pQueryHandle->loadType == BLOCK_LOAD_TABLE_SEQ_ORDER) {
|
||||
return loadDataBlockFromTableSeq(pQueryHandle);
|
||||
} else { // loadType == RR and Offset Order
|
||||
if (pQueryHandle->checkFiles) {
|
||||
// check if the query range overlaps with the file data block
|
||||
bool exists = true;
|
||||
|
||||
int32_t code = getDataBlocksInFiles(pQueryHandle, &exists);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
pQueryHandle->activeIndex = 0;
|
||||
pQueryHandle->checkFiles = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exists) {
|
||||
pQueryHandle->cost.checkForNextTime += (taosGetTimestampUs() - stime);
|
||||
return exists;
|
||||
}
|
||||
|
||||
pQueryHandle->activeIndex = 0;
|
||||
pQueryHandle->checkFiles = false;
|
||||
}
|
||||
|
||||
// TODO: opt by consider the scan order
|
||||
bool ret = doHasDataInBuffer(pQueryHandle);
|
||||
terrno = TSDB_CODE_SUCCESS;
|
||||
|
||||
elapsedTime = taosGetTimestampUs() - stime;
|
||||
pQueryHandle->cost.checkForNextTime += elapsedTime;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SMemRef* pMemRef) {
|
||||
|
@ -2480,7 +2569,7 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
|
|||
}
|
||||
|
||||
// load the previous row
|
||||
STsdbQueryCond cond = {.numOfCols = numOfCols, .loadExternalRows = false,};
|
||||
STsdbQueryCond cond = {.numOfCols = numOfCols, .loadExternalRows = false, .type = BLOCK_LOAD_OFFSET_SEQ_ORDER};
|
||||
if (type == TSDB_PREV_ROW) {
|
||||
cond.order = TSDB_ORDER_DESC;
|
||||
cond.twindow = (STimeWindow){pQueryHandle->window.skey, INT64_MIN};
|
||||
|
@ -2501,12 +2590,13 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
|
|||
}
|
||||
|
||||
pSecQueryHandle = tsdbQueryTablesImpl(pQueryHandle->pTsdb, &cond, pQueryHandle->qinfo, pMemRef);
|
||||
|
||||
tfree(cond.colList);
|
||||
|
||||
SArray* psTable = NULL;
|
||||
// current table, only one table
|
||||
STableCheckInfo* pCurrent = taosArrayGet(pQueryHandle->pTableCheckInfo, pQueryHandle->activeIndex);
|
||||
|
||||
pSecQueryHandle->pTableCheckInfo = createCheckInfoFromCheckInfo(pQueryHandle->pTableCheckInfo, pSecQueryHandle->window.skey, &psTable);
|
||||
SArray* psTable = NULL;
|
||||
pSecQueryHandle->pTableCheckInfo = createCheckInfoFromCheckInfo(pCurrent, pSecQueryHandle->window.skey, &psTable);
|
||||
if (pSecQueryHandle->pTableCheckInfo == NULL) {
|
||||
terrno = TSDB_CODE_QRY_OUT_OF_MEMORY;
|
||||
goto out_of_memory;
|
||||
|
@ -2514,7 +2604,6 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
|
|||
|
||||
|
||||
tsdbMayTakeMemSnapshot(pSecQueryHandle, psTable);
|
||||
|
||||
if (!tsdbNextDataBlock((void*)pSecQueryHandle)) {
|
||||
// no result in current query, free the corresponding result rows structure
|
||||
if (type == TSDB_PREV_ROW) {
|
||||
|
@ -2544,20 +2633,18 @@ out_of_memory:
|
|||
return terrno;
|
||||
}
|
||||
|
||||
SArray* tsdbGetExternalRow(TsdbQueryHandleT *pHandle, SDataBlockInfo* blockInfo) {
|
||||
bool tsdbGetExternalRow(TsdbQueryHandleT pHandle) {
|
||||
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*) pHandle;
|
||||
int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle);
|
||||
|
||||
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, 0);
|
||||
blockInfo->tid = pCheckInfo->tableId.tid;
|
||||
blockInfo->uid = pCheckInfo->tableId.uid;
|
||||
blockInfo->numOfCols = numOfCols;
|
||||
SQueryFilePos* cur = &pQueryHandle->cur;
|
||||
|
||||
cur->fid = INT32_MIN;
|
||||
cur->mixBlock = true;
|
||||
if (pQueryHandle->prev == NULL || pQueryHandle->next == NULL) {
|
||||
blockInfo->rows = 0;
|
||||
return NULL;
|
||||
cur->rows = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle);
|
||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||
SColumnInfoData* pColInfoData = taosArrayGet(pQueryHandle->pColumns, i);
|
||||
SColumnInfoData* first = taosArrayGet(pQueryHandle->prev, i);
|
||||
|
@ -2568,13 +2655,13 @@ SArray* tsdbGetExternalRow(TsdbQueryHandleT *pHandle, SDataBlockInfo* blockInfo)
|
|||
memcpy(pColInfoData->pData + pColInfoData->info.bytes, sec->pData, pColInfoData->info.bytes);
|
||||
|
||||
if (i == 0 && pColInfoData->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
|
||||
blockInfo->window.skey = *(TSKEY*)pColInfoData->pData;
|
||||
blockInfo->window.ekey = *(TSKEY*)(pColInfoData->pData + TSDB_KEYSIZE);
|
||||
cur->win.skey = *(TSKEY*)pColInfoData->pData;
|
||||
cur->win.ekey = *(TSKEY*)(pColInfoData->pData + TSDB_KEYSIZE);
|
||||
}
|
||||
}
|
||||
|
||||
blockInfo->rows = 2;
|
||||
return pQueryHandle->pColumns;
|
||||
cur->rows = 2;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxTablesperVnode -v 100
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
|
|||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 100
|
||||
|
|
|
@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
|
|||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 100
|
||||
|
|
|
@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
|
|||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 100
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxTablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 500
|
||||
sql connect
|
||||
|
|
|
@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
|
|||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 500
|
||||
sql connect
|
||||
|
|
|
@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
|
|||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -579,7 +579,7 @@ $tb = $tbPrefix . 0
|
|||
|
||||
## interp(*) from stb + group by + fill(none)
|
||||
$t = $ts0 + 1000
|
||||
sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname
|
||||
sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c debugFlag -v 135
|
||||
system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 135
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c rowsInFileBlock -v 255
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c rowsInFileBlock -v 255
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
|
|||
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 100
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 200
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sleep 100
|
||||
sql connect
|
||||
|
|
|
@ -1,88 +1,88 @@
|
|||
#run general/parser/alter.sim
|
||||
#sleep 100
|
||||
#run general/parser/alter1.sim
|
||||
#sleep 100
|
||||
#run general/parser/alter_stable.sim
|
||||
#sleep 100
|
||||
#run general/parser/auto_create_tb.sim
|
||||
#sleep 100
|
||||
#run general/parser/auto_create_tb_drop_tb.sim
|
||||
#sleep 100
|
||||
#run general/parser/col_arithmetic_operation.sim
|
||||
#sleep 100
|
||||
#run general/parser/columnValue.sim
|
||||
#sleep 100
|
||||
#run general/parser/commit.sim
|
||||
#sleep 100
|
||||
#run general/parser/create_db.sim
|
||||
#sleep 100
|
||||
#run general/parser/create_mt.sim
|
||||
#sleep 100
|
||||
#run general/parser/create_tb.sim
|
||||
#sleep 100
|
||||
#run general/parser/dbtbnameValidate.sim
|
||||
#sleep 100
|
||||
#run general/parser/fill.sim
|
||||
#sleep 100
|
||||
#run general/parser/fill_stb.sim
|
||||
#sleep 100
|
||||
##run general/parser/fill_us.sim #
|
||||
#sleep 100
|
||||
#run general/parser/first_last.sim
|
||||
#sleep 100
|
||||
#run general/parser/import_commit1.sim
|
||||
#sleep 100
|
||||
#run general/parser/import_commit2.sim
|
||||
#sleep 100
|
||||
#run general/parser/import_commit3.sim
|
||||
#sleep 100
|
||||
##run general/parser/import_file.sim
|
||||
#sleep 100
|
||||
#run general/parser/insert_tb.sim
|
||||
#sleep 100
|
||||
#run general/parser/tags_dynamically_specifiy.sim
|
||||
#sleep 100
|
||||
#run general/parser/interp.sim
|
||||
#sleep 100
|
||||
#run general/parser/lastrow.sim
|
||||
#sleep 100
|
||||
#run general/parser/limit.sim
|
||||
#sleep 100
|
||||
#run general/parser/limit1.sim
|
||||
#sleep 100
|
||||
#run general/parser/limit1_tblocks100.sim
|
||||
#sleep 100
|
||||
#run general/parser/limit2.sim
|
||||
#sleep 100
|
||||
#run general/parser/mixed_blocks.sim
|
||||
#sleep 100
|
||||
#run general/parser/nchar.sim
|
||||
#sleep 100
|
||||
#run general/parser/null_char.sim
|
||||
#sleep 100
|
||||
#run general/parser/selectResNum.sim
|
||||
#sleep 100
|
||||
#run general/parser/select_across_vnodes.sim
|
||||
#sleep 100
|
||||
#run general/parser/select_from_cache_disk.sim
|
||||
#sleep 100
|
||||
#run general/parser/set_tag_vals.sim
|
||||
#sleep 100
|
||||
#run general/parser/single_row_in_tb.sim
|
||||
#sleep 100
|
||||
#run general/parser/slimit.sim
|
||||
#sleep 100
|
||||
#run general/parser/slimit1.sim
|
||||
#sleep 100
|
||||
#run general/parser/slimit_alter_tags.sim
|
||||
#sleep 100
|
||||
#run general/parser/tbnameIn.sim
|
||||
#sleep 100
|
||||
#run general/parser/slimit_alter_tags.sim # persistent failed
|
||||
#sleep 100
|
||||
#run general/parser/join.sim
|
||||
#sleep 100
|
||||
#run general/parser/join_multivnode.sim
|
||||
run general/parser/alter.sim
|
||||
sleep 100
|
||||
run general/parser/alter1.sim
|
||||
sleep 100
|
||||
run general/parser/alter_stable.sim
|
||||
sleep 100
|
||||
run general/parser/auto_create_tb.sim
|
||||
sleep 100
|
||||
run general/parser/auto_create_tb_drop_tb.sim
|
||||
sleep 100
|
||||
run general/parser/col_arithmetic_operation.sim
|
||||
sleep 100
|
||||
run general/parser/columnValue.sim
|
||||
sleep 100
|
||||
run general/parser/commit.sim
|
||||
sleep 100
|
||||
run general/parser/create_db.sim
|
||||
sleep 100
|
||||
run general/parser/create_mt.sim
|
||||
sleep 100
|
||||
run general/parser/create_tb.sim
|
||||
sleep 100
|
||||
run general/parser/dbtbnameValidate.sim
|
||||
sleep 100
|
||||
run general/parser/fill.sim
|
||||
sleep 100
|
||||
run general/parser/fill_stb.sim
|
||||
sleep 100
|
||||
#run general/parser/fill_us.sim #
|
||||
sleep 100
|
||||
run general/parser/first_last.sim
|
||||
sleep 100
|
||||
run general/parser/import_commit1.sim
|
||||
sleep 100
|
||||
run general/parser/import_commit2.sim
|
||||
sleep 100
|
||||
run general/parser/import_commit3.sim
|
||||
sleep 100
|
||||
#run general/parser/import_file.sim
|
||||
sleep 100
|
||||
run general/parser/insert_tb.sim
|
||||
sleep 100
|
||||
run general/parser/tags_dynamically_specifiy.sim
|
||||
sleep 100
|
||||
run general/parser/interp.sim
|
||||
sleep 100
|
||||
run general/parser/lastrow.sim
|
||||
sleep 100
|
||||
run general/parser/limit.sim
|
||||
sleep 100
|
||||
run general/parser/limit1.sim
|
||||
sleep 100
|
||||
run general/parser/limit1_tblocks100.sim
|
||||
sleep 100
|
||||
run general/parser/limit2.sim
|
||||
sleep 100
|
||||
run general/parser/mixed_blocks.sim
|
||||
sleep 100
|
||||
run general/parser/nchar.sim
|
||||
sleep 100
|
||||
run general/parser/null_char.sim
|
||||
sleep 100
|
||||
run general/parser/selectResNum.sim
|
||||
sleep 100
|
||||
run general/parser/select_across_vnodes.sim
|
||||
sleep 100
|
||||
run general/parser/select_from_cache_disk.sim
|
||||
sleep 100
|
||||
run general/parser/set_tag_vals.sim
|
||||
sleep 100
|
||||
run general/parser/single_row_in_tb.sim
|
||||
sleep 100
|
||||
run general/parser/slimit.sim
|
||||
sleep 100
|
||||
run general/parser/slimit1.sim
|
||||
sleep 100
|
||||
run general/parser/slimit_alter_tags.sim
|
||||
sleep 100
|
||||
run general/parser/tbnameIn.sim
|
||||
sleep 100
|
||||
run general/parser/slimit_alter_tags.sim # persistent failed
|
||||
sleep 100
|
||||
run general/parser/join.sim
|
||||
sleep 100
|
||||
run general/parser/join_multivnode.sim
|
||||
sleep 100
|
||||
run general/parser/projection_limit_offset.sim
|
||||
sleep 100
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 200
|
||||
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c debugFlag -v 135
|
||||
system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 135
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
system sh/stop_dnodes.sh
|
||||
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
|
|
Loading…
Reference in New Issue