Merge branch 'szhou/select-tags-scan' of github.com:taosdata/TDengine into szhou/select-tags-scan

This commit is contained in:
slzhou 2023-08-16 10:30:16 +08:00
commit d7c55cf8fc
1 changed files with 14 additions and 2 deletions

View File

@ -367,12 +367,24 @@ static bool tagScanNodeHasTbname(SNode* pKeys) {
}
static int32_t setTagScanExecutionMode(SScanLogicNode* pScan) {
//TODO: set pScan->onlyMetaCtbIdx
bool bOnlyMetaCtbIdx = false;
if (tagScanNodeListHasTbname(pScan->pScanPseudoCols)) {
bOnlyMetaCtbIdx = false;
return TSDB_CODE_SUCCESS;
}
if (pScan->node.pConditions == NULL) {
bOnlyMetaCtbIdx = true;
return TSDB_CODE_SUCCESS;
}
SNode* pCond = nodesCloneNode(pScan->node.pConditions);
SNode* pTagCond = NULL;
SNode* pTagIndexCond = NULL;
bool bOnlyMetaCtbIdx = false;
filterPartitionCond(&pCond, NULL, &pTagIndexCond, &pTagCond, NULL);
if (pTagIndexCond || tagScanNodeListHasTbname(pScan->pScanPseudoCols) || tagScanNodeHasTbname(pTagCond)) {
if (pTagIndexCond || tagScanNodeHasTbname(pTagCond)) {
bOnlyMetaCtbIdx = false;
} else {
bOnlyMetaCtbIdx = true;