提交 e8cae58f 编写于 作者: M Minglei Jin

Merge branch 'refact/tsdb_optimize' of https://github.com/taosdata/TDengine...

Merge branch 'refact/tsdb_optimize' of https://github.com/taosdata/TDengine into refact/tsdb_optimize
......@@ -105,12 +105,16 @@ void tLDataIterNextBlock(SLDataIter *pIter) {
size_t size = taosArrayGetSize(pIter->aBlockL);
for(int32_t i = pIter->iBlockL; i < size && i >= 0; i += step) {
SBlockL *p = taosArrayGet(pIter->aBlockL, i);
if (p->minUid <= pIter->uid && p->maxUid >= pIter->uid) {
index = i;
if ((!pIter->backward) && p->minUid > pIter->uid) {
break;
}
if (pIter->backward && p->maxUid < pIter->uid) {
break;
}
if (p->minUid > pIter->uid) {
if (p->minUid <= pIter->uid && p->maxUid >= pIter->uid) {
index = i;
break;
}
}
......@@ -145,8 +149,18 @@ static void findNextValidRow(SLDataIter* pIter) {
}
int64_t ts = pIter->bData.aTSKEY[i];
if (ts < pIter->timeWindow.skey) {
continue;
if (!pIter->backward) { // asc
if (ts > pIter->timeWindow.ekey) { // no more data
break;
} else if (ts < pIter->timeWindow.skey) {
continue;
}
} else {
if (ts < pIter->timeWindow.skey) {
break;
} else if (ts > pIter->timeWindow.ekey) {
continue;
}
}
int64_t ver = pIter->bData.aVersion[i];
......@@ -154,11 +168,6 @@ static void findNextValidRow(SLDataIter* pIter) {
continue;
}
// no data any more, todo opt handle desc case
if (ts > pIter->timeWindow.ekey) {
continue;
}
// todo opt handle desc case
if (ver > pIter->verRange.maxVer) {
continue;
......@@ -235,8 +244,7 @@ _exit:
}
SRowInfo *tLDataIterGet(SLDataIter *pIter) {
// TODO
return NULL;
return &pIter->rInfo;
}
// SMergeTree =================================================
......
......@@ -636,6 +636,7 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SArray*
{
// 1. time range check
printf("%ld, %ld\n", pLastBlock->minKey, pLastBlock->maxKey);
if (pLastBlock->minKey > pReader->window.ekey || pLastBlock->maxKey < pReader->window.skey) {
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册