Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e29ca4f5
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看板
提交
e29ca4f5
编写于
2月 03, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(query): use real number of stt instead of default value.
上级
baaa5756
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
17 addition
and
10 deletion
+17
-10
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+2
-1
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+2
-1
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+8
-6
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+5
-2
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
e29ca4f5
...
...
@@ -645,6 +645,7 @@ typedef struct SSttBlockLoadInfo {
int16_t
*
colIds
;
int32_t
numOfCols
;
bool
sttBlockLoaded
;
int32_t
numOfStt
;
// keep the last access position, this position may be used to reduce the binary times for
// starting last block data for a new table
...
...
@@ -710,7 +711,7 @@ bool tMergeTreeNext(SMergeTree *pMTree);
TSDBROW
tMergeTreeGetRow
(
SMergeTree
*
pMTree
);
void
tMergeTreeClose
(
SMergeTree
*
pMTree
);
SSttBlockLoadInfo
*
tCreateLastBlockLoadInfo
(
STSchema
*
pSchema
,
int16_t
*
colList
,
int32_t
numOfCols
);
SSttBlockLoadInfo
*
tCreateLastBlockLoadInfo
(
STSchema
*
pSchema
,
int16_t
*
colList
,
int32_t
numOfCols
,
int32_t
numOfStt
);
void
resetLastBlockLoadInfo
(
SSttBlockLoadInfo
*
pLoadInfo
);
void
getLastBlockLoadInfo
(
SSttBlockLoadInfo
*
pLoadInfo
,
int64_t
*
blocks
,
double
*
el
);
void
*
destroyLastBlockLoadInfo
(
SSttBlockLoadInfo
*
pLoadInfo
);
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
e29ca4f5
...
...
@@ -138,7 +138,8 @@ int32_t tsdbCacherowsReaderOpen(void* pVnode, int32_t type, void* pTableIdList,
}
}
p
->
pLoadInfo
=
tCreateLastBlockLoadInfo
(
p
->
pSchema
,
NULL
,
0
);
int32_t
numOfStt
=
((
SVnode
*
)
pVnode
)
->
config
.
sttTrigger
;
p
->
pLoadInfo
=
tCreateLastBlockLoadInfo
(
p
->
pSchema
,
NULL
,
0
,
numOfStt
);
if
(
p
->
pLoadInfo
==
NULL
)
{
tsdbCacherowsReaderClose
(
p
);
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
浏览文件 @
e29ca4f5
...
...
@@ -31,14 +31,16 @@ struct SLDataIter {
SSttBlockLoadInfo
*
pBlockLoadInfo
;
};
SSttBlockLoadInfo
*
tCreateLastBlockLoadInfo
(
STSchema
*
pSchema
,
int16_t
*
colList
,
int32_t
numOfCols
)
{
SSttBlockLoadInfo
*
pLoadInfo
=
taosMemoryCalloc
(
TSDB_MAX_STT_TRIGGER
,
sizeof
(
SSttBlockLoadInfo
));
SSttBlockLoadInfo
*
tCreateLastBlockLoadInfo
(
STSchema
*
pSchema
,
int16_t
*
colList
,
int32_t
numOfCols
,
int32_t
numOfSttTrigger
)
{
SSttBlockLoadInfo
*
pLoadInfo
=
taosMemoryCalloc
(
numOfSttTrigger
,
sizeof
(
SSttBlockLoadInfo
));
if
(
pLoadInfo
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
}
for
(
int32_t
i
=
0
;
i
<
TSDB_MAX_STT_TRIGGER
;
++
i
)
{
pLoadInfo
->
numOfStt
=
numOfSttTrigger
;
for
(
int32_t
i
=
0
;
i
<
numOfSttTrigger
;
++
i
)
{
pLoadInfo
[
i
].
blockIndex
[
0
]
=
-
1
;
pLoadInfo
[
i
].
blockIndex
[
1
]
=
-
1
;
pLoadInfo
[
i
].
currentLoadBlockIndex
=
1
;
...
...
@@ -63,7 +65,7 @@ SSttBlockLoadInfo *tCreateLastBlockLoadInfo(STSchema *pSchema, int16_t *colList,
}
void
resetLastBlockLoadInfo
(
SSttBlockLoadInfo
*
pLoadInfo
)
{
for
(
int32_t
i
=
0
;
i
<
TSDB_MAX_STT_TRIGGER
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pLoadInfo
->
numOfStt
;
++
i
)
{
pLoadInfo
[
i
].
currentLoadBlockIndex
=
1
;
pLoadInfo
[
i
].
blockIndex
[
0
]
=
-
1
;
pLoadInfo
[
i
].
blockIndex
[
1
]
=
-
1
;
...
...
@@ -77,14 +79,14 @@ void resetLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo) {
}
void
getLastBlockLoadInfo
(
SSttBlockLoadInfo
*
pLoadInfo
,
int64_t
*
blocks
,
double
*
el
)
{
for
(
int32_t
i
=
0
;
i
<
TSDB_MAX_STT_TRIGGER
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pLoadInfo
->
numOfStt
;
++
i
)
{
*
el
+=
pLoadInfo
[
i
].
elapsedTime
;
*
blocks
+=
pLoadInfo
[
i
].
loadBlocks
;
}
}
void
*
destroyLastBlockLoadInfo
(
SSttBlockLoadInfo
*
pLoadInfo
)
{
for
(
int32_t
i
=
0
;
i
<
TSDB_MAX_STT_TRIGGER
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pLoadInfo
->
numOfStt
;
++
i
)
{
pLoadInfo
[
i
].
currentLoadBlockIndex
=
1
;
pLoadInfo
[
i
].
blockIndex
[
0
]
=
-
1
;
pLoadInfo
[
i
].
blockIndex
[
1
]
=
-
1
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
e29ca4f5
...
...
@@ -482,8 +482,11 @@ static int32_t initFilesetIterator(SFilesetIter* pIter, SArray* aDFileSet, STsdb
if
(
pLReader
->
pInfo
==
NULL
)
{
// here we ignore the first column, which is always be the primary timestamp column
SBlockLoadSuppInfo
*
pInfo
=
&
pReader
->
suppInfo
;
int32_t
numOfStt
=
pReader
->
pTsdb
->
pVnode
->
config
.
sttTrigger
;
pLReader
->
pInfo
=
tCreateLastBlockLoadInfo
(
pReader
->
pSchema
,
&
p
Reader
->
suppInfo
.
colId
[
1
],
pReader
->
suppInfo
.
numOfCols
-
1
);
tCreateLastBlockLoadInfo
(
pReader
->
pSchema
,
&
p
Info
->
colId
[
1
],
pInfo
->
numOfCols
-
1
,
numOfStt
);
if
(
pLReader
->
pInfo
==
NULL
)
{
tsdbDebug
(
"init fileset iterator failed, code:%s %s"
,
tstrerror
(
terrno
),
pReader
->
idStr
);
return
terrno
;
...
...
@@ -655,7 +658,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
goto
_end
;
}
setColumnIdSlotList
(
&
pReader
->
suppInfo
,
pCond
->
colList
,
pCond
->
pSlotList
,
pCond
->
numOfCols
);
setColumnIdSlotList
(
pSup
,
pCond
->
colList
,
pCond
->
pSlotList
,
pCond
->
numOfCols
);
*
ppReader
=
pReader
;
return
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录