Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e3786685
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看板
未验证
提交
e3786685
编写于
2月 10, 2023
作者:
H
Haojun Liao
提交者:
GitHub
2月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #19915 from taosdata/fix/nodisk
ehn(query): dynamic set the initial buffer size for data block from d…
上级
19903eb0
c8f1c3b6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
8 addition
and
22 deletion
+8
-22
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+3
-21
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+5
-1
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
e3786685
...
@@ -423,19 +423,6 @@ static STimeWindow updateQueryTimeWindow(STsdb* pTsdb, STimeWindow* pWindow) {
...
@@ -423,19 +423,6 @@ static STimeWindow updateQueryTimeWindow(STsdb* pTsdb, STimeWindow* pWindow) {
return
win
;
return
win
;
}
}
static
void
limitOutputBufferSize
(
const
SQueryTableDataCond
*
pCond
,
int32_t
*
capacity
)
{
int32_t
rowLen
=
0
;
for
(
int32_t
i
=
0
;
i
<
pCond
->
numOfCols
;
++
i
)
{
rowLen
+=
pCond
->
colList
[
i
].
bytes
;
}
// make sure the output SSDataBlock size be less than 2MB.
const
int32_t
TWOMB
=
2
*
1024
*
1024
;
if
((
*
capacity
)
*
rowLen
>
TWOMB
)
{
(
*
capacity
)
=
TWOMB
/
rowLen
;
}
}
// init file iterator
// init file iterator
static
int32_t
initFilesetIterator
(
SFilesetIter
*
pIter
,
SArray
*
aDFileSet
,
STsdbReader
*
pReader
)
{
static
int32_t
initFilesetIterator
(
SFilesetIter
*
pIter
,
SArray
*
aDFileSet
,
STsdbReader
*
pReader
)
{
size_t
numOfFileset
=
taosArrayGetSize
(
aDFileSet
);
size_t
numOfFileset
=
taosArrayGetSize
(
aDFileSet
);
...
@@ -618,9 +605,6 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
...
@@ -618,9 +605,6 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
goto
_end
;
goto
_end
;
}
}
// todo refactor.
limitOutputBufferSize
(
pCond
,
&
pReader
->
capacity
);
// allocate buffer in order to load data blocks from file
// allocate buffer in order to load data blocks from file
SBlockLoadSuppInfo
*
pSup
=
&
pReader
->
suppInfo
;
SBlockLoadSuppInfo
*
pSup
=
&
pReader
->
suppInfo
;
pSup
->
pColAgg
=
taosArrayInit
(
pCond
->
numOfCols
,
sizeof
(
SColumnDataAgg
));
pSup
->
pColAgg
=
taosArrayInit
(
pCond
->
numOfCols
,
sizeof
(
SColumnDataAgg
));
...
@@ -3835,11 +3819,9 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
...
@@ -3835,11 +3819,9 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
pCond
->
twindows
.
ekey
-=
1
;
pCond
->
twindows
.
ekey
-=
1
;
}
}
int32_t
capacity
=
0
;
int32_t
capacity
=
pVnode
->
config
.
tsdbCfg
.
maxRows
;
if
(
pResBlock
==
NULL
)
{
if
(
pResBlock
!=
NULL
)
{
capacity
=
4096
;
blockDataEnsureCapacity
(
pResBlock
,
capacity
);
}
else
{
capacity
=
pResBlock
->
info
.
capacity
;
}
}
int32_t
code
=
tsdbReaderCreate
(
pVnode
,
pCond
,
ppReader
,
capacity
,
pResBlock
,
idstr
);
int32_t
code
=
tsdbReaderCreate
(
pVnode
,
pCond
,
ppReader
,
capacity
,
pResBlock
,
idstr
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
e3786685
...
@@ -781,6 +781,10 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) {
...
@@ -781,6 +781,10 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) {
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
T_LONG_JMP
(
pTaskInfo
->
env
,
code
);
T_LONG_JMP
(
pTaskInfo
->
env
,
code
);
}
}
if
(
pInfo
->
pResBlock
->
info
.
capacity
>
pOperator
->
resultInfo
.
capacity
)
{
pOperator
->
resultInfo
.
capacity
=
pInfo
->
pResBlock
->
info
.
capacity
;
}
}
}
SSDataBlock
*
result
=
doGroupedTableScan
(
pOperator
);
SSDataBlock
*
result
=
doGroupedTableScan
(
pOperator
);
...
@@ -884,7 +888,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
...
@@ -884,7 +888,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
initResultSizeInfo
(
&
pOperator
->
resultInfo
,
4096
);
initResultSizeInfo
(
&
pOperator
->
resultInfo
,
4096
);
pInfo
->
pResBlock
=
createDataBlockFromDescNode
(
pDescNode
);
pInfo
->
pResBlock
=
createDataBlockFromDescNode
(
pDescNode
);
blockDataEnsureCapacity
(
pInfo
->
pResBlock
,
pOperator
->
resultInfo
.
capacity
);
//
blockDataEnsureCapacity(pInfo->pResBlock, pOperator->resultInfo.capacity);
code
=
filterInitFromNode
((
SNode
*
)
pTableScanNode
->
scan
.
node
.
pConditions
,
&
pOperator
->
exprSupp
.
pFilterInfo
,
0
);
code
=
filterInitFromNode
((
SNode
*
)
pTableScanNode
->
scan
.
node
.
pConditions
,
&
pOperator
->
exprSupp
.
pFilterInfo
,
0
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录