Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8b82fdf0
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8b82fdf0
编写于
11月 16, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): correct calc sort page size
上级
4b4f8eac
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
13 deletion
+16
-13
include/util/tdef.h
include/util/tdef.h
+3
-0
source/libs/executor/inc/tsort.h
source/libs/executor/inc/tsort.h
+2
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-1
source/libs/executor/src/sortoperator.c
source/libs/executor/src/sortoperator.c
+2
-1
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+7
-10
未找到文件。
include/util/tdef.h
浏览文件 @
8b82fdf0
...
...
@@ -489,6 +489,9 @@ enum {
#define MAX_META_MSG_IN_BATCH 1048576
#define MAX_META_BATCH_RSP_SIZE (1 * 1048576 * 1024)
// sort page size by default
#define DEFAULT_PAGESIZE 4096
#ifdef __cplusplus
}
#endif
...
...
source/libs/executor/inc/tsort.h
浏览文件 @
8b82fdf0
...
...
@@ -163,9 +163,10 @@ SSortExecInfo tsortGetSortExecInfo(SSortHandle* pHandle);
/**
* get proper sort buffer pages according to the row size
* @param rowSize
* @param numOfCols columns count that be put into page
* @return
*/
int32_t
getProperSortPageSize
(
size_t
rowSize
);
int32_t
getProperSortPageSize
(
size_t
rowSize
,
uint32_t
numOfCols
);
#ifdef __cplusplus
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
8b82fdf0
...
...
@@ -4822,7 +4822,8 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN
initLimitInfo
(
pTableScanNode
->
scan
.
node
.
pLimit
,
pTableScanNode
->
scan
.
node
.
pSlimit
,
&
pInfo
->
limitInfo
);
int32_t
rowSize
=
pInfo
->
pResBlock
->
info
.
rowSize
;
pInfo
->
bufPageSize
=
getProperSortPageSize
(
rowSize
);
uint32_t
numOfCols
=
taosArrayGetSize
(
pInfo
->
pResBlock
->
pDataBlock
);
pInfo
->
bufPageSize
=
getProperSortPageSize
(
rowSize
,
numOfCols
);
setOperatorInfo
(
pOperator
,
"TableMergeScanOperator"
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
...
...
source/libs/executor/src/sortoperator.c
浏览文件 @
8b82fdf0
...
...
@@ -760,7 +760,8 @@ SOperatorInfo* createMultiwayMergeOperatorInfo(SOperatorInfo** downStreams, size
pInfo
->
groupSort
=
pMergePhyNode
->
groupSort
;
pInfo
->
pSortInfo
=
createSortInfo
(
pMergePhyNode
->
pMergeKeys
);
pInfo
->
pInputBlock
=
pInputBlock
;
pInfo
->
bufPageSize
=
getProperSortPageSize
(
rowSize
);
size_t
numOfCols
=
taosArrayGetSize
(
pInfo
->
binfo
.
pRes
->
pDataBlock
);
pInfo
->
bufPageSize
=
getProperSortPageSize
(
rowSize
,
numOfCols
);
pInfo
->
sortBufSize
=
pInfo
->
bufPageSize
*
(
numStreams
+
1
);
// one additional is reserved for merged result.
setOperatorInfo
(
pOperator
,
"MultiwayMergeOperator"
,
QUERY_NODE_PHYSICAL_PLAN_MERGE
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
...
...
source/libs/executor/src/tsort.c
浏览文件 @
8b82fdf0
...
...
@@ -584,15 +584,11 @@ static int32_t doInternalMergeSort(SSortHandle* pHandle) {
return
0
;
}
// TODO consider the page meta size
int32_t
getProperSortPageSize
(
size_t
rowSize
)
{
uint32_t
defaultPageSize
=
4096
;
uint32_t
pgSize
=
0
;
if
(
rowSize
*
4
>
defaultPageSize
)
{
pgSize
=
rowSize
*
4
;
}
else
{
pgSize
=
defaultPageSize
;
// get sort page size
int32_t
getProperSortPageSize
(
size_t
rowSize
,
uint32_t
numOfCols
)
{
uint32_t
pgSize
=
rowSize
*
4
+
blockDataGetSerialMetaSize
(
numOfCols
);
if
(
pgSize
<
DEFAULT_PAGESIZE
)
{
return
DEFAULT_PAGESIZE
;
}
return
pgSize
;
...
...
@@ -612,7 +608,8 @@ static int32_t createInitialSources(SSortHandle* pHandle) {
}
if
(
pHandle
->
pDataBlock
==
NULL
)
{
pHandle
->
pageSize
=
getProperSortPageSize
(
blockDataGetRowSize
(
pBlock
));
uint32_t
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
pHandle
->
pageSize
=
getProperSortPageSize
(
blockDataGetRowSize
(
pBlock
),
numOfCols
);
// todo, number of pages are set according to the total available sort buffer
pHandle
->
numOfPages
=
1024
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录