Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f7a8393c
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看板
提交
f7a8393c
编写于
2月 20, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add perf logs
上级
28693ce2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
0 deletion
+25
-0
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+4
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+21
-0
未找到文件。
source/libs/executor/inc/executorimpl.h
浏览文件 @
f7a8393c
...
...
@@ -228,6 +228,10 @@ typedef struct SOperatorInfo {
struct
SOperatorInfo
**
pDownstream
;
// downstram pointer list
int32_t
numOfDownstream
;
// number of downstream. The value is always ONE expect for join operator
SOperatorFpSet
fpSet
;
int64_t
downstreamTime
;
int64_t
funcInitTime
;
int64_t
funcExecTime
;
int64_t
funcFinTime
;
}
SOperatorInfo
;
typedef
enum
{
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
f7a8393c
...
...
@@ -517,7 +517,9 @@ static int32_t doAggregateImpl(SOperatorInfo* pOperator, SqlFunctionCtx* pCtx) {
continue
;
}
int64_t
st
=
taosGetTimestampUs
();
int32_t
code
=
pCtx
[
k
].
fpSet
.
process
(
&
pCtx
[
k
]);
pOperator
->
funcExecTime
+=
taosGetTimestampUs
()
-
st
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"%s aggregate function error happens, code: %s"
,
GET_TASKID
(
pOperator
->
pTaskInfo
),
tstrerror
(
code
));
return
code
;
...
...
@@ -1035,7 +1037,10 @@ void doSetTableGroupOutputBuf(SOperatorInfo* pOperator, int32_t numOfOutput, uin
}
}
int64_t
st
=
taosGetTimestampUs
();
setResultRowInitCtx
(
pResultRow
,
pCtx
,
numOfOutput
,
rowEntryInfoOffset
);
pOperator
->
funcInitTime
+=
taosGetTimestampUs
()
-
st
;
}
static
void
setExecutionContext
(
SOperatorInfo
*
pOperator
,
int32_t
numOfOutput
,
uint64_t
groupId
)
{
...
...
@@ -1252,7 +1257,9 @@ void doBuildResultDatablock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SG
doCopyToSDataBlock
(
pTaskInfo
,
pBlock
,
&
pOperator
->
exprSupp
,
pBuf
,
pGroupResInfo
);
}
else
{
while
(
hasRemainResults
(
pGroupResInfo
))
{
int64_t
st
=
taosGetTimestampUs
();
doCopyToSDataBlock
(
pTaskInfo
,
pBlock
,
&
pOperator
->
exprSupp
,
pBuf
,
pGroupResInfo
);
pOperator
->
funcFinTime
+=
taosGetTimestampUs
()
-
st
;
if
(
pBlock
->
info
.
rows
>=
pOperator
->
resultInfo
.
threshold
)
{
break
;
}
...
...
@@ -1577,6 +1584,7 @@ static int32_t doOpenAggregateOptr(SOperatorInfo* pOperator) {
while
(
1
)
{
st
=
taosGetTimestampUs
();
SSDataBlock
*
pBlock
=
downstream
->
fpSet
.
getNextFn
(
downstream
);
pOperator
->
downstreamTime
+=
taosGetTimestampUs
()
-
st
;
if
(
pBlock
==
NULL
)
{
if
(
!
hasValidBlock
)
{
createDataBlockForEmptyInput
(
pOperator
,
&
pBlock
);
...
...
@@ -1694,6 +1702,15 @@ void destroyOperatorInfo(SOperatorInfo* pOperator) {
return
;
}
if
(
pOperator
->
operatorType
==
QUERY_NODE_PHYSICAL_PLAN_HASH_AGG
)
{
double
downstream
=
(
double
)
pOperator
->
downstreamTime
/
1000000
;
double
init
=
(
double
)
pOperator
->
funcInitTime
/
1000000
;
double
exec
=
(
double
)
pOperator
->
funcExecTime
/
1000000
;
double
fin
=
(
double
)
pOperator
->
funcFinTime
/
1000000
;
qError
(
"operator: %s, downstream time:%lf, init time:%lf, exec time:%lf, fin time:%lf"
,
pOperator
->
name
,
downstream
,
init
,
exec
,
fin
);
}
if
(
pOperator
->
fpSet
.
closeFn
!=
NULL
)
{
pOperator
->
fpSet
.
closeFn
(
pOperator
->
info
);
}
...
...
@@ -1910,6 +1927,10 @@ SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SAggPhysiN
pTaskInfo
);
pOperator
->
fpSet
=
createOperatorFpSet
(
doOpenAggregateOptr
,
getAggregateResult
,
NULL
,
destroyAggOperatorInfo
,
optrDefaultBufFn
,
NULL
);
pOperator
->
downstreamTime
=
0
;
pOperator
->
funcInitTime
=
0
;
pOperator
->
funcExecTime
=
0
;
pOperator
->
funcFinTime
=
0
;
if
(
downstream
->
operatorType
==
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
)
{
STableScanInfo
*
pTableScanInfo
=
downstream
->
info
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录