提交 eec58b8e 编写于 作者: wmmhello's avatar wmmhello

opti:use suid+uid->tags index to optimize time cost

上级 95ef68bb
......@@ -1425,6 +1425,7 @@ size_t blockDataGetCapacityInRow(const SSDataBlock* pBlock, size_t pageSize) {
}
void colDataDestroy(SColumnInfoData* pColData) {
if(!pColData) return;
if (IS_VAR_DATA_TYPE(pColData->info.type)) {
taosMemoryFreeClear(pColData->varmeta.offset);
} else {
......
......@@ -87,7 +87,7 @@ int metaOpen(SVnode *pVnode, SMeta **ppMeta) {
}
// open pCtbIdx
ret = tdbTbOpen("ctb.idx", sizeof(SCtbIdxKey), 0, ctbIdxKeyCmpr, pMeta->pEnv, &pMeta->pCtbIdx);
ret = tdbTbOpen("ctb.idx", sizeof(SCtbIdxKey), -1, ctbIdxKeyCmpr, pMeta->pEnv, &pMeta->pCtbIdx);
if (ret < 0) {
metaError("vgId:%d, failed to open meta child table index since %s", TD_VID(pVnode), tstrerror(terrno));
goto _err;
......
......@@ -385,7 +385,9 @@ SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray* uidLi
}
int32_t rows = taosArrayGetSize(uidList);
if(rows == 0){
goto end;
}
int64_t stt1 = taosGetTimestampUs();
qDebug("generate tag meta rows:%d, cost:%ld us", rows, stt1-stt);
......@@ -397,8 +399,7 @@ SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray* uidLi
int64_t st = taosGetTimestampUs();
for (int32_t i = 0; i < rows; i++) {
uint64_t* uid = taosArrayGet(uidList, i);
void* tag = taosArrayGet(tags, i);
void* tag = taosArrayGetP(tags, i);
// int64_t stt = taosGetTimestampUs();
// int64_t stt1 = taosGetTimestampUs();
// qDebug("generate tag get meta rows:%d, cost:%ld ms", rows, stt1-stt);
......@@ -498,16 +499,18 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
}
int32_t i = 0;
while (i < taosArrayGetSize(pListInfo->pTableList)) {
while (i < taosArrayGetSize(res) && pColInfoData) {
void* var = POINTER_SHIFT(pColInfoData->pData, i * pColInfoData->info.bytes);
if (*(bool*)var == false) {
taosArrayRemove(pListInfo->pTableList, i);
taosArrayRemove(res, i);
continue;
}
i++;
}
colDataDestroy(pColInfoData);
}else{
vnodeGetCtbIdList(pVnode, pScanNode->suid, res);
}
for (int i = 0; i < taosArrayGetSize(res); i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册