Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ec159239
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看板
提交
ec159239
编写于
1月 28, 2023
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: limit push down error
上级
83a711c3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
12 deletion
+20
-12
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+20
-12
未找到文件。
source/libs/planner/src/planSpliter.c
浏览文件 @
ec159239
...
...
@@ -348,7 +348,8 @@ static bool stbSplIsPartTableAgg(SAggLogicNode* pAgg) {
return
false
;
}
if
(
NULL
!=
pAgg
->
pGroupKeys
)
{
return
stbSplHasPartTbname
(
pAgg
->
pGroupKeys
)
&&
stbSplNotSystemScan
((
SLogicNode
*
)
nodesListGetNode
(
pAgg
->
node
.
pChildren
,
0
));
return
stbSplHasPartTbname
(
pAgg
->
pGroupKeys
)
&&
stbSplNotSystemScan
((
SLogicNode
*
)
nodesListGetNode
(
pAgg
->
node
.
pChildren
,
0
));
}
return
stbSplHasPartTbname
(
stbSplGetPartKeys
((
SLogicNode
*
)
nodesListGetNode
(
pAgg
->
node
.
pChildren
,
0
)));
}
...
...
@@ -1025,21 +1026,29 @@ static int32_t stbSplSplitSortNode(SSplitContext* pCxt, SStableSplitInfo* pInfo)
return
code
;
}
static
int32_t
stbSpl
SplitScanNodeWithoutPartTags
(
SSplitContext
*
pCxt
,
SStableSplitInfo
*
pInfo
)
{
SLogicNode
*
pSplitNode
=
pInfo
->
pSplitNode
;
static
int32_t
stbSpl
GetSplitNodeForScan
(
SStableSplitInfo
*
pInfo
,
SLogicNode
**
pSplitNode
)
{
*
pSplitNode
=
pInfo
->
pSplitNode
;
if
(
NULL
!=
pInfo
->
pSplitNode
->
pParent
&&
QUERY_NODE_LOGIC_PLAN_PROJECT
==
nodeType
(
pInfo
->
pSplitNode
->
pParent
)
&&
NULL
==
pInfo
->
pSplitNode
->
pParent
->
pLimit
&&
NULL
==
pInfo
->
pSplitNode
->
pParent
->
pSlimit
)
{
pSplitNode
=
pInfo
->
pSplitNode
->
pParent
;
*
pSplitNode
=
pInfo
->
pSplitNode
->
pParent
;
if
(
NULL
!=
pInfo
->
pSplitNode
->
pLimit
)
{
pSplitNode
->
pLimit
=
nodesCloneNode
(
pInfo
->
pSplitNode
->
pLimit
);
if
(
NULL
==
pSplitNode
->
pLimit
)
{
(
*
pSplitNode
)
->
pLimit
=
nodesCloneNode
(
pInfo
->
pSplitNode
->
pLimit
);
if
(
NULL
==
(
*
pSplitNode
)
->
pLimit
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
((
SLimitNode
*
)
pInfo
->
pSplitNode
->
pLimit
)
->
limit
+=
((
SLimitNode
*
)
pInfo
->
pSplitNode
->
pLimit
)
->
offset
;
((
SLimitNode
*
)
pInfo
->
pSplitNode
->
pLimit
)
->
offset
=
0
;
}
}
int32_t
code
=
splCreateExchangeNodeForSubplan
(
pCxt
,
pInfo
->
pSubplan
,
pSplitNode
,
SUBPLAN_TYPE_MERGE
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
stbSplSplitScanNodeWithoutPartTags
(
SSplitContext
*
pCxt
,
SStableSplitInfo
*
pInfo
)
{
SLogicNode
*
pSplitNode
=
NULL
;
int32_t
code
=
stbSplGetSplitNodeForScan
(
pInfo
,
&
pSplitNode
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
splCreateExchangeNodeForSubplan
(
pCxt
,
pInfo
->
pSubplan
,
pSplitNode
,
SUBPLAN_TYPE_MERGE
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodesListMakeStrictAppend
(
&
pInfo
->
pSubplan
->
pChildren
,
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pSplitNode
,
SPLIT_FLAG_STABLE_SPLIT
));
...
...
@@ -1049,12 +1058,11 @@ static int32_t stbSplSplitScanNodeWithoutPartTags(SSplitContext* pCxt, SStableSp
}
static
int32_t
stbSplSplitScanNodeWithPartTags
(
SSplitContext
*
pCxt
,
SStableSplitInfo
*
pInfo
)
{
SLogicNode
*
pSplitNode
=
pInfo
->
pSplitNode
;
i
f
(
NULL
!=
pInfo
->
pSplitNode
->
pParent
&&
QUERY_NODE_LOGIC_PLAN_PROJECT
==
nodeType
(
pInfo
->
pSplitNode
->
pParent
)
&&
NULL
==
pInfo
->
pSplitNode
->
pParent
->
pLimit
&&
NULL
==
pInfo
->
pSplitNode
->
pParent
->
pSlimit
)
{
pSplitNode
=
pInfo
->
pSplitNode
->
pParent
;
SLogicNode
*
pSplitNode
=
NULL
;
i
nt32_t
code
=
stbSplGetSplitNodeForScan
(
pInfo
,
&
pSplitNode
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
stbSplCreateMergeNode
(
pCxt
,
pInfo
->
pSubplan
,
pSplitNode
,
NULL
,
pSplitNode
,
true
)
;
}
int32_t
code
=
stbSplCreateMergeNode
(
pCxt
,
pInfo
->
pSubplan
,
pSplitNode
,
NULL
,
pSplitNode
,
true
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodesListMakeStrictAppend
(
&
pInfo
->
pSubplan
->
pChildren
,
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pSplitNode
,
SPLIT_FLAG_STABLE_SPLIT
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录