未验证 提交 f8276707 编写于 作者: S shenglian-zhou 提交者: GitHub

Merge pull request #14973 from taosdata/szhou/feature/user-tags

fix: enable tag scan optimization when the scan cols is empty before adding ts col
......@@ -78,6 +78,7 @@ typedef struct SScanLogicNode {
SNodeList* pGroupTags;
bool groupSort;
int8_t cacheLastMode;
bool hasNormalCols; // neither tag column nor primary key tag column
} SScanLogicNode;
typedef struct SJoinLogicNode {
......
......@@ -278,6 +278,10 @@ static int32_t createScanLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect
pScan->scanType = getScanType(pCxt, pScan->pScanPseudoCols, pScan->pScanCols, pScan->tableType);
if (NULL != pScan->pScanCols) {
pScan->hasNormalCols = true;
}
if (TSDB_CODE_SUCCESS == code) {
code = addPrimaryKeyCol(pScan->tableId, &pScan->pScanCols);
}
......
......@@ -2113,7 +2113,7 @@ static bool tagScanMayBeOptimized(SLogicNode* pNode) {
return false;
}
SScanLogicNode* pScan = (SScanLogicNode*)pNode;
if (NULL != pScan->pScanCols) {
if (pScan->hasNormalCols) {
return false;
}
if (NULL == pNode->pParent || QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode->pParent) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册