Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
杠杠峰
TDengine
提交
0dcfd711
TDengine
项目概览
杠杠峰
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0dcfd711
编写于
8月 27, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-255] avoid unnecessary one more check for super table query.
上级
604efc00
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
20 deletion
+19
-20
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+19
-20
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
0dcfd711
...
@@ -230,6 +230,12 @@ static void destroyStateWindowOperatorInfo(void* param, int32_t numOfOutput);
...
@@ -230,6 +230,12 @@ static void destroyStateWindowOperatorInfo(void* param, int32_t numOfOutput);
static
void
destroyAggOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
);
static
void
destroyAggOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
);
static
void
destroyOperatorInfo
(
SOperatorInfo
*
pOperator
);
static
void
destroyOperatorInfo
(
SOperatorInfo
*
pOperator
);
static
void
doSetOperatorCompleted
(
SOperatorInfo
*
pOperator
)
{
pOperator
->
status
=
OP_EXEC_DONE
;
if
(
pOperator
->
pRuntimeEnv
!=
NULL
)
{
setQueryStatus
(
pOperator
->
pRuntimeEnv
,
QUERY_COMPLETED
);
}
}
static
int32_t
doCopyToSDataBlock
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
int32_t
orderType
,
SSDataBlock
*
pBlock
);
static
int32_t
doCopyToSDataBlock
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
int32_t
orderType
,
SSDataBlock
*
pBlock
);
...
@@ -5517,8 +5523,7 @@ static SSDataBlock* doSort(void* param, bool* newgroup) {
...
@@ -5517,8 +5523,7 @@ static SSDataBlock* doSort(void* param, bool* newgroup) {
// start to flush data into disk and try do multiway merge sort
// start to flush data into disk and try do multiway merge sort
if
(
pBlock
==
NULL
)
{
if
(
pBlock
==
NULL
)
{
setQueryStatus
(
pOperator
->
pRuntimeEnv
,
QUERY_COMPLETED
);
doSetOperatorCompleted
(
pOperator
);
pOperator
->
status
=
OP_EXEC_DONE
;
break
;
break
;
}
}
...
@@ -5629,8 +5634,7 @@ static SSDataBlock* doAggregate(void* param, bool* newgroup) {
...
@@ -5629,8 +5634,7 @@ static SSDataBlock* doAggregate(void* param, bool* newgroup) {
doAggregateImpl
(
pOperator
,
pQueryAttr
->
window
.
skey
,
pInfo
->
pCtx
,
pBlock
);
doAggregateImpl
(
pOperator
,
pQueryAttr
->
window
.
skey
,
pInfo
->
pCtx
,
pBlock
);
}
}
pOperator
->
status
=
OP_EXEC_DONE
;
doSetOperatorCompleted
(
pOperator
);
setQueryStatus
(
pRuntimeEnv
,
QUERY_COMPLETED
);
finalizeQueryResult
(
pOperator
,
pInfo
->
pCtx
,
&
pInfo
->
resultRowInfo
,
pInfo
->
rowCellInfoOffset
);
finalizeQueryResult
(
pOperator
,
pInfo
->
pCtx
,
&
pInfo
->
resultRowInfo
,
pInfo
->
rowCellInfoOffset
);
pInfo
->
pRes
->
info
.
rows
=
getNumOfResult
(
pRuntimeEnv
,
pInfo
->
pCtx
,
pOperator
->
numOfOutput
);
pInfo
->
pRes
->
info
.
rows
=
getNumOfResult
(
pRuntimeEnv
,
pInfo
->
pCtx
,
pOperator
->
numOfOutput
);
...
@@ -5706,7 +5710,7 @@ static SSDataBlock* doSTableAggregate(void* param, bool* newgroup) {
...
@@ -5706,7 +5710,7 @@ static SSDataBlock* doSTableAggregate(void* param, bool* newgroup) {
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pInfo
->
pRes
);
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pInfo
->
pRes
);
if
(
pInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
if
(
pInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
pOperator
->
status
=
OP_EXEC_DONE
;
doSetOperatorCompleted
(
pOperator
)
;
}
}
return
pInfo
->
pRes
;
return
pInfo
->
pRes
;
...
@@ -5824,8 +5828,7 @@ static SSDataBlock* doLimit(void* param, bool* newgroup) {
...
@@ -5824,8 +5828,7 @@ static SSDataBlock* doLimit(void* param, bool* newgroup) {
publishOperatorProfEvent
(
pOperator
->
upstream
[
0
],
QUERY_PROF_AFTER_OPERATOR_EXEC
);
publishOperatorProfEvent
(
pOperator
->
upstream
[
0
],
QUERY_PROF_AFTER_OPERATOR_EXEC
);
if
(
pBlock
==
NULL
)
{
if
(
pBlock
==
NULL
)
{
setQueryStatus
(
pOperator
->
pRuntimeEnv
,
QUERY_COMPLETED
);
doSetOperatorCompleted
(
pOperator
);
pOperator
->
status
=
OP_EXEC_DONE
;
return
NULL
;
return
NULL
;
}
}
...
@@ -5853,8 +5856,7 @@ static SSDataBlock* doLimit(void* param, bool* newgroup) {
...
@@ -5853,8 +5856,7 @@ static SSDataBlock* doLimit(void* param, bool* newgroup) {
pBlock
->
info
.
rows
=
(
int32_t
)(
pInfo
->
limit
-
pInfo
->
total
);
pBlock
->
info
.
rows
=
(
int32_t
)(
pInfo
->
limit
-
pInfo
->
total
);
pInfo
->
total
=
pInfo
->
limit
;
pInfo
->
total
=
pInfo
->
limit
;
setQueryStatus
(
pOperator
->
pRuntimeEnv
,
QUERY_COMPLETED
);
doSetOperatorCompleted
(
pOperator
);
pOperator
->
status
=
OP_EXEC_DONE
;
}
else
{
}
else
{
pInfo
->
total
+=
pBlock
->
info
.
rows
;
pInfo
->
total
+=
pBlock
->
info
.
rows
;
}
}
...
@@ -5889,8 +5891,7 @@ static SSDataBlock* doFilter(void* param, bool* newgroup) {
...
@@ -5889,8 +5891,7 @@ static SSDataBlock* doFilter(void* param, bool* newgroup) {
}
}
}
}
setQueryStatus
(
pRuntimeEnv
,
QUERY_COMPLETED
);
doSetOperatorCompleted
(
pOperator
);
pOperator
->
status
=
OP_EXEC_DONE
;
return
NULL
;
return
NULL
;
}
}
...
@@ -5905,9 +5906,8 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) {
...
@@ -5905,9 +5906,8 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) {
SQueryRuntimeEnv
*
pRuntimeEnv
=
pOperator
->
pRuntimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
pOperator
->
pRuntimeEnv
;
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pIntervalInfo
->
pRes
);
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pIntervalInfo
->
pRes
);
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
pOperator
->
status
=
OP_EXEC_DONE
;
doSetOperatorCompleted
(
pOperator
)
;
}
}
return
pIntervalInfo
->
pRes
;
return
pIntervalInfo
->
pRes
;
...
@@ -5948,7 +5948,7 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) {
...
@@ -5948,7 +5948,7 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) {
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pIntervalInfo
->
pRes
);
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pIntervalInfo
->
pRes
);
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
pOperator
->
status
=
OP_EXEC_DONE
;
doSetOperatorCompleted
(
pOperator
)
;
}
}
return
pIntervalInfo
->
pRes
->
info
.
rows
==
0
?
NULL
:
pIntervalInfo
->
pRes
;
return
pIntervalInfo
->
pRes
->
info
.
rows
==
0
?
NULL
:
pIntervalInfo
->
pRes
;
...
@@ -5967,7 +5967,7 @@ static SSDataBlock* doAllIntervalAgg(void* param, bool* newgroup) {
...
@@ -5967,7 +5967,7 @@ static SSDataBlock* doAllIntervalAgg(void* param, bool* newgroup) {
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pIntervalInfo
->
pRes
);
toSSDataBlock
(
&
pRuntimeEnv
->
groupResInfo
,
pRuntimeEnv
,
pIntervalInfo
->
pRes
);
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainDataInCurrentGroup
(
&
pRuntimeEnv
->
groupResInfo
))
{
pOperator
->
status
=
OP_EXEC_DONE
;
doSetOperatorCompleted
(
pOperator
)
;
}
}
return
pIntervalInfo
->
pRes
;
return
pIntervalInfo
->
pRes
;
...
@@ -6025,9 +6025,10 @@ static SSDataBlock* doSTableIntervalAgg(void* param, bool* newgroup) {
...
@@ -6025,9 +6025,10 @@ static SSDataBlock* doSTableIntervalAgg(void* param, bool* newgroup) {
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
int64_t
st
=
taosGetTimestampUs
();
int64_t
st
=
taosGetTimestampUs
();
copyToSDataBlock
(
pRuntimeEnv
,
3000
,
pIntervalInfo
->
pRes
,
pIntervalInfo
->
rowCellInfoOffset
);
copyToSDataBlock
(
pRuntimeEnv
,
3000
,
pIntervalInfo
->
pRes
,
pIntervalInfo
->
rowCellInfoOffset
);
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainData
(
&
pRuntimeEnv
->
groupResInfo
))
{
if
(
pIntervalInfo
->
pRes
->
info
.
rows
==
0
||
!
hasRemainData
(
&
pRuntimeEnv
->
groupResInfo
))
{
pOperator
->
status
=
OP_EXEC_DONE
;
doSetOperatorCompleted
(
pOperator
)
;
}
}
SQInfo
*
pQInfo
=
pRuntimeEnv
->
qinfo
;
SQInfo
*
pQInfo
=
pRuntimeEnv
->
qinfo
;
...
@@ -7286,13 +7287,11 @@ static SSDataBlock* hashDistinct(void* param, bool* newgroup) {
...
@@ -7286,13 +7287,11 @@ static SSDataBlock* hashDistinct(void* param, bool* newgroup) {
publishOperatorProfEvent
(
pOperator
->
upstream
[
0
],
QUERY_PROF_AFTER_OPERATOR_EXEC
);
publishOperatorProfEvent
(
pOperator
->
upstream
[
0
],
QUERY_PROF_AFTER_OPERATOR_EXEC
);
if
(
pBlock
==
NULL
)
{
if
(
pBlock
==
NULL
)
{
setQueryStatus
(
pOperator
->
pRuntimeEnv
,
QUERY_COMPLETED
);
doSetOperatorCompleted
(
pOperator
);
pOperator
->
status
=
OP_EXEC_DONE
;
break
;
break
;
}
}
if
(
!
initMultiDistinctInfo
(
pInfo
,
pOperator
,
pBlock
))
{
if
(
!
initMultiDistinctInfo
(
pInfo
,
pOperator
,
pBlock
))
{
setQueryStatus
(
pOperator
->
pRuntimeEnv
,
QUERY_COMPLETED
);
doSetOperatorCompleted
(
pOperator
);
pOperator
->
status
=
OP_EXEC_DONE
;
break
;
break
;
}
}
// ensure result output buf
// ensure result output buf
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录