Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8bb432c3
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8bb432c3
编写于
7月 25, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: super table order by primary key optimization
上级
cf8bf7bd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
3 deletion
+12
-3
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+1
-0
source/libs/nodes/src/nodesCloneFuncs.c
source/libs/nodes/src/nodesCloneFuncs.c
+2
-0
source/libs/parser/src/parAstCreater.c
source/libs/parser/src/parAstCreater.c
+1
-0
source/libs/planner/src/planLogicCreater.c
source/libs/planner/src/planLogicCreater.c
+5
-3
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+3
-0
未找到文件。
include/libs/nodes/querynodes.h
浏览文件 @
8bb432c3
...
...
@@ -255,6 +255,7 @@ typedef struct SSelectStmt {
int32_t
selectFuncNum
;
bool
isEmptyResult
;
bool
isTimeLineResult
;
bool
isSubquery
;
bool
hasAggFuncs
;
bool
hasRepeatScanFuncs
;
bool
hasIndefiniteRowsFunc
;
...
...
source/libs/nodes/src/nodesCloneFuncs.c
浏览文件 @
8bb432c3
...
...
@@ -375,6 +375,7 @@ static int32_t logicJoinCopy(const SJoinLogicNode* pSrc, SJoinLogicNode* pDst) {
CLONE_NODE_FIELD
(
pMergeCondition
);
CLONE_NODE_FIELD
(
pOnConditions
);
COPY_SCALAR_FIELD
(
isSingleTableJoin
);
COPY_SCALAR_FIELD
(
inputTsOrder
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -440,6 +441,7 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p
COPY_SCALAR_FIELD
(
watermark
);
COPY_SCALAR_FIELD
(
igExpired
);
COPY_SCALAR_FIELD
(
windowAlgo
);
COPY_SCALAR_FIELD
(
inputTsOrder
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/parser/src/parAstCreater.c
浏览文件 @
8bb432c3
...
...
@@ -527,6 +527,7 @@ SNode* createTempTableNode(SAstCreateContext* pCxt, SNode* pSubquery, const STok
}
if
(
QUERY_NODE_SELECT_STMT
==
nodeType
(
pSubquery
))
{
strcpy
(((
SSelectStmt
*
)
pSubquery
)
->
stmtName
,
tempTable
->
table
.
tableAlias
);
((
SSelectStmt
*
)
pSubquery
)
->
isSubquery
=
true
;
}
else
if
(
QUERY_NODE_SET_OPERATOR
==
nodeType
(
pSubquery
))
{
strcpy
(((
SSetOperator
*
)
pSubquery
)
->
stmtName
,
tempTable
->
table
.
tableAlias
);
}
...
...
source/libs/planner/src/planLogicCreater.c
浏览文件 @
8bb432c3
...
...
@@ -339,6 +339,7 @@ static int32_t createJoinLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect
pJoin
->
joinType
=
pJoinTable
->
joinType
;
pJoin
->
isSingleTableJoin
=
pJoinTable
->
table
.
singleTable
;
pJoin
->
inputTsOrder
=
ORDER_ASC
;
pJoin
->
node
.
groupAction
=
GROUP_ACTION_CLEAR
;
pJoin
->
node
.
requireDataOrder
=
DATA_ORDER_LEVEL_GLOBAL
;
pJoin
->
node
.
requireDataOrder
=
DATA_ORDER_LEVEL_GLOBAL
;
...
...
@@ -625,14 +626,14 @@ static int32_t createInterpFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt* p
static
int32_t
createWindowLogicNodeFinalize
(
SLogicPlanContext
*
pCxt
,
SSelectStmt
*
pSelect
,
SWindowLogicNode
*
pWindow
,
SLogicNode
**
pLogicNode
)
{
int32_t
code
=
nodesCollectFuncs
(
pSelect
,
SQL_CLAUSE_WINDOW
,
fmIsWindowClauseFunc
,
&
pWindow
->
pFuncs
);
if
(
pCxt
->
pPlanCxt
->
streamQuery
)
{
pWindow
->
triggerType
=
pCxt
->
pPlanCxt
->
triggerType
;
pWindow
->
watermark
=
pCxt
->
pPlanCxt
->
watermark
;
pWindow
->
igExpired
=
pCxt
->
pPlanCxt
->
igExpired
;
}
pWindow
->
inputTsOrder
=
ORDER_ASC
;
int32_t
code
=
nodesCollectFuncs
(
pSelect
,
SQL_CLAUSE_WINDOW
,
fmIsWindowClauseFunc
,
&
pWindow
->
pFuncs
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
rewriteExprsForSelect
(
pWindow
->
pFuncs
,
pSelect
,
SQL_CLAUSE_WINDOW
);
}
...
...
@@ -861,7 +862,8 @@ static int32_t createProjectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSel
TSWAP
(
pProject
->
node
.
pLimit
,
pSelect
->
pLimit
);
TSWAP
(
pProject
->
node
.
pSlimit
,
pSelect
->
pSlimit
);
pProject
->
node
.
groupAction
=
GROUP_ACTION_CLEAR
;
pProject
->
node
.
groupAction
=
(
!
pSelect
->
isSubquery
&&
pCxt
->
pPlanCxt
->
streamQuery
)
?
GROUP_ACTION_KEEP
:
GROUP_ACTION_CLEAR
;
pProject
->
node
.
requireDataOrder
=
DATA_ORDER_LEVEL_NONE
;
pProject
->
node
.
resultDataOrder
=
DATA_ORDER_LEVEL_NONE
;
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
8bb432c3
...
...
@@ -974,6 +974,9 @@ static int32_t createInterpFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pCh
}
static
bool
projectCanMergeDataBlock
(
SProjectLogicNode
*
pProject
)
{
if
(
GROUP_ACTION_KEEP
==
pProject
->
node
.
groupAction
)
{
return
false
;
}
if
(
DATA_ORDER_LEVEL_NONE
==
pProject
->
node
.
resultDataOrder
)
{
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录