Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1172e668
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看板
提交
1172e668
编写于
2月 08, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] for performance profile.
上级
2b846376
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
18 deletion
+40
-18
2.0/src/query/inc/qExecutor.h
2.0/src/query/inc/qExecutor.h
+1
-1
2.0/src/query/src/qExecutor.c
2.0/src/query/src/qExecutor.c
+7
-7
source/common/src/tep.c
source/common/src/tep.c
+3
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-1
source/libs/executor/test/executorTests.cpp
source/libs/executor/test/executorTests.cpp
+28
-8
未找到文件。
2.0/src/query/inc/qExecutor.h
浏览文件 @
1172e668
...
...
@@ -622,7 +622,7 @@ void doCompactSDataBlock(SSDataBlock* pBlock, int32_t numOfRows, int8_t* p);
SSDataBlock
*
createOutputBuf
(
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
int32_t
numOfRows
);
void
*
destroySDataBlock
(
SSDataBlock
*
pBlock
);
void
*
blockDataDestroy
(
SSDataBlock
*
pBlock
);
void
*
doDestroyFilterInfo
(
SSingleColumnFilterInfo
*
pFilterInfo
,
int32_t
numOfFilterCols
);
void
setInputDataBlock
(
SOperatorInfo
*
pOperator
,
SQLFunctionCtx
*
pCtx
,
SSDataBlock
*
pBlock
,
int32_t
order
);
...
...
2.0/src/query/src/qExecutor.c
浏览文件 @
1172e668
...
...
@@ -336,7 +336,7 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO
return
res
;
}
void
*
destroySDataBlock
(
SSDataBlock
*
pBlock
)
{
void
*
blockDataDestroy
(
SSDataBlock
*
pBlock
)
{
if
(
pBlock
==
NULL
)
{
return
NULL
;
}
...
...
@@ -5373,7 +5373,7 @@ static void destroyGlobalAggOperatorInfo(void* param, int32_t numOfOutput) {
static
void
destroySlimitOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
SSLimitOperatorInfo
*
pInfo
=
(
SSLimitOperatorInfo
*
)
param
;
taosArrayDestroy
(
pInfo
->
orderColumnList
);
pInfo
->
pRes
=
destroySDataBlock
(
pInfo
->
pRes
);
pInfo
->
pRes
=
blockDataDestroy
(
pInfo
->
pRes
);
tfree
(
pInfo
->
prevRow
);
}
...
...
@@ -6566,7 +6566,7 @@ static void doDestroyBasicInfo(SOptrBasicInfo* pInfo, int32_t numOfOutput) {
tfree
(
pInfo
->
rowCellInfoOffset
);
cleanupResultRowInfo
(
&
pInfo
->
resultRowInfo
);
pInfo
->
pRes
=
destroySDataBlock
(
pInfo
->
pRes
);
pInfo
->
pRes
=
blockDataDestroy
(
pInfo
->
pRes
);
}
static
void
destroyBasicOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
...
...
@@ -6590,7 +6590,7 @@ static void destroySWindowOperatorInfo(void* param, int32_t numOfOutput) {
static
void
destroySFillOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
SFillOperatorInfo
*
pInfo
=
(
SFillOperatorInfo
*
)
param
;
pInfo
->
pFillInfo
=
taosDestroyFillInfo
(
pInfo
->
pFillInfo
);
pInfo
->
pRes
=
destroySDataBlock
(
pInfo
->
pRes
);
pInfo
->
pRes
=
blockDataDestroy
(
pInfo
->
pRes
);
tfree
(
pInfo
->
p
);
}
...
...
@@ -6607,12 +6607,12 @@ static void destroyProjectOperatorInfo(void* param, int32_t numOfOutput) {
static
void
destroyTagScanOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
STagScanInfo
*
pInfo
=
(
STagScanInfo
*
)
param
;
pInfo
->
pRes
=
destroySDataBlock
(
pInfo
->
pRes
);
pInfo
->
pRes
=
blockDataDestroy
(
pInfo
->
pRes
);
}
static
void
destroyOrderOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
SOrderOperatorInfo
*
pInfo
=
(
SOrderOperatorInfo
*
)
param
;
pInfo
->
pDataBlock
=
destroySDataBlock
(
pInfo
->
pDataBlock
);
pInfo
->
pDataBlock
=
blockDataDestroy
(
pInfo
->
pDataBlock
);
}
static
void
destroyConditionOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
...
...
@@ -6625,7 +6625,7 @@ static void destroyDistinctOperatorInfo(void* param, int32_t numOfOutput) {
taosHashCleanup
(
pInfo
->
pSet
);
tfree
(
pInfo
->
buf
);
taosArrayDestroy
(
pInfo
->
pDistinctDataInfo
);
pInfo
->
pRes
=
destroySDataBlock
(
pInfo
->
pRes
);
pInfo
->
pRes
=
blockDataDestroy
(
pInfo
->
pRes
);
}
SOperatorInfo
*
createMultiTableAggOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
)
{
...
...
source/common/src/tep.c
浏览文件 @
1172e668
...
...
@@ -643,6 +643,8 @@ static int32_t doAssignOneTuple(SColumnInfoData* pDstCols, int32_t numOfRows, co
}
}
}
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
blockDataAssign
(
SColumnInfoData
*
pCols
,
const
SSDataBlock
*
pDataBlock
,
int32_t
*
index
)
{
...
...
@@ -777,7 +779,7 @@ int32_t blockDataSort(SSDataBlock* pDataBlock, SArray* pOrderInfo, bool nullFirs
copyBackToBlock
(
pDataBlock
,
pCols
);
int64_t
p4
=
taosGetTimestampUs
();
printf
(
"sort:%ld, create:%ld, assign:%ld, copyback:%ld
\n
"
,
p1
-
p0
,
p2
-
p1
,
p3
-
p2
,
p4
-
p3
);
printf
(
"sort:%ld, create:%ld, assign:%ld, copyback:%ld
, rows:%d
\n
"
,
p1
-
p0
,
p2
-
p1
,
p3
-
p2
,
p4
-
p3
,
rows
);
destroyTupleIndex
(
index
);
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
1172e668
...
...
@@ -5865,7 +5865,7 @@ SOperatorInfo *createOrderOperatorInfo(SOperatorInfo* downstream, SArray* pExprI
return
NULL
;
}
pInfo
->
sortBufSize
=
1024
*
1024
;
// 1MB
pInfo
->
sortBufSize
=
1024
*
1024
*
5
;
// 1MB
pInfo
->
capacity
=
4096
;
pInfo
->
pDataBlock
=
createOutputBuf_rv
(
pExprInfo
,
pInfo
->
capacity
);
pInfo
->
pSources
=
taosArrayInit
(
4
,
POINTER_BYTES
);
...
...
source/libs/executor/test/executorTests.cpp
浏览文件 @
1172e668
...
...
@@ -255,16 +255,36 @@ TEST(testCase, external_sort_Test) {
exp1
->
base
.
resSchema
=
createSchema
(
TSDB_DATA_TYPE_BINARY
,
40
,
2
,
"res1"
);
taosArrayPush
(
pExprInfo
,
&
exp1
);
SOperatorInfo
*
pOperator
=
createOrderOperatorInfo
(
createDummyOperator
(
1
00
),
pExprInfo
,
pOrderVal
);
SOperatorInfo
*
pOperator
=
createOrderOperatorInfo
(
createDummyOperator
(
5
00
),
pExprInfo
,
pOrderVal
);
bool
newgroup
=
false
;
SSDataBlock
*
pRes
=
pOperator
->
exec
(
pOperator
,
&
newgroup
)
;
SSDataBlock
*
pRes
=
NULL
;
SColumnInfoData
*
pCol1
=
static_cast
<
SColumnInfoData
*>
(
taosArrayGet
(
pRes
->
pDataBlock
,
0
));
SColumnInfoData
*
pCol2
=
static_cast
<
SColumnInfoData
*>
(
taosArrayGet
(
pRes
->
pDataBlock
,
1
));
for
(
int32_t
i
=
0
;
i
<
pRes
->
info
.
rows
;
++
i
)
{
char
*
p
=
colDataGet
(
pCol2
,
i
);
printf
(
"%d: %d, %s
\n
"
,
i
,
((
int32_t
*
)
pCol1
->
pData
)[
i
],
(
char
*
)
varDataVal
(
p
));
}
int32_t
total
=
1
;
// while(1) {
int64_t
s
=
taosGetTimestampUs
();
pRes
=
pOperator
->
exec
(
pOperator
,
&
newgroup
);
int64_t
e
=
taosGetTimestampUs
();
printf
(
"---------------elapsed:%ld
\n
"
,
e
-
s
);
if
(
pRes
==
NULL
)
{
// break;
}
SColumnInfoData
*
pCol1
=
static_cast
<
SColumnInfoData
*>
(
taosArrayGet
(
pRes
->
pDataBlock
,
0
));
SColumnInfoData
*
pCol2
=
static_cast
<
SColumnInfoData
*>
(
taosArrayGet
(
pRes
->
pDataBlock
,
1
));
for
(
int32_t
i
=
0
;
i
<
pRes
->
info
.
rows
;
++
i
)
{
char
*
p
=
colDataGet
(
pCol2
,
i
);
// printf("%d: %d, %s\n", total++, ((int32_t*)pCol1->pData)[i], (char*)varDataVal(p));
}
// }
pOperator
->
cleanupFn
(
pOperator
->
info
,
2
);
tfree
(
exp
);
tfree
(
exp1
);
taosArrayDestroy
(
pExprInfo
);
taosArrayDestroy
(
pOrderVal
);
}
#pragma GCC diagnostic pop
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录