Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6f252d8d
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看板
提交
6f252d8d
编写于
9月 06, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): opt perf on last block query.
上级
a5933fc6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
5 addition
and
18 deletion
+5
-18
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+0
-1
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+5
-17
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
6f252d8d
...
@@ -644,7 +644,6 @@ typedef struct {
...
@@ -644,7 +644,6 @@ typedef struct {
}
SRowInfo
;
}
SRowInfo
;
typedef
struct
SSttBlockLoadInfo
{
typedef
struct
SSttBlockLoadInfo
{
int32_t
sttFileIndex
;
SBlockData
blockData
[
2
];
SBlockData
blockData
[
2
];
SArray
*
aSttBlk
;
SArray
*
aSttBlk
;
int32_t
blockIndex
[
2
];
// to denote the loaded block in the corresponding position.
int32_t
blockIndex
[
2
];
// to denote the loaded block in the corresponding position.
...
...
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
浏览文件 @
6f252d8d
...
@@ -90,22 +90,23 @@ static SBlockData* loadBlockIfMissing(SLDataIter *pIter) {
...
@@ -90,22 +90,23 @@ static SBlockData* loadBlockIfMissing(SLDataIter *pIter) {
int32_t
code
=
0
;
int32_t
code
=
0
;
SSttBlockLoadInfo
*
pInfo
=
pIter
->
pBlockLoadInfo
;
SSttBlockLoadInfo
*
pInfo
=
pIter
->
pBlockLoadInfo
;
if
(
pInfo
->
blockIndex
[
0
]
==
pIter
->
iStt
)
{
if
(
pInfo
->
blockIndex
[
0
]
==
pIter
->
iStt
Blk
)
{
return
&
pInfo
->
blockData
[
0
];
return
&
pInfo
->
blockData
[
0
];
}
}
if
(
pInfo
->
blockIndex
[
1
]
==
pIter
->
iStt
)
{
if
(
pInfo
->
blockIndex
[
1
]
==
pIter
->
iStt
Blk
)
{
return
&
pInfo
->
blockData
[
1
];
return
&
pInfo
->
blockData
[
1
];
}
}
pInfo
->
currentLoadBlockIndex
^=
1
;
pInfo
->
currentLoadBlockIndex
^=
1
;
if
(
pIter
->
pSttBlk
!=
NULL
)
{
// current block not loaded yet
if
(
pIter
->
pSttBlk
!=
NULL
)
{
// current block not loaded yet
code
=
tsdbReadSttBlock
(
pIter
->
pReader
,
pIter
->
iStt
,
pIter
->
pSttBlk
,
&
pInfo
->
blockData
[
pInfo
->
currentLoadBlockIndex
]);
code
=
tsdbReadSttBlock
(
pIter
->
pReader
,
pIter
->
iStt
,
pIter
->
pSttBlk
,
&
pInfo
->
blockData
[
pInfo
->
currentLoadBlockIndex
]);
tsdbDebug
(
"read last block, index:%d, last file index:%d"
,
pIter
->
iSttBlk
,
pIter
->
iStt
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_exit
;
goto
_exit
;
}
}
pInfo
->
blockIndex
[
pInfo
->
currentLoadBlockIndex
]
=
pIter
->
iStt
;
pInfo
->
blockIndex
[
pInfo
->
currentLoadBlockIndex
]
=
pIter
->
iStt
Blk
;
pIter
->
iRow
=
(
pIter
->
backward
)
?
pInfo
->
blockData
[
pInfo
->
currentLoadBlockIndex
].
nRow
:
-
1
;
pIter
->
iRow
=
(
pIter
->
backward
)
?
pInfo
->
blockData
[
pInfo
->
currentLoadBlockIndex
].
nRow
:
-
1
;
}
}
...
@@ -136,26 +137,13 @@ int32_t tLDataIterOpen(struct SLDataIter **pIter, SDataFReader *pReader, int32_t
...
@@ -136,26 +137,13 @@ int32_t tLDataIterOpen(struct SLDataIter **pIter, SDataFReader *pReader, int32_t
(
*
pIter
)
->
timeWindow
=
*
pTimeWindow
;
(
*
pIter
)
->
timeWindow
=
*
pTimeWindow
;
(
*
pIter
)
->
pBlockLoadInfo
=
pBlockLoadInfo
;
(
*
pIter
)
->
pBlockLoadInfo
=
pBlockLoadInfo
;
if
(
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
)
==
0
)
{
if
(
pBlockLoadInfo
->
aSttBlk
==
NULL
)
{
// loaded into the common shared objects
pBlockLoadInfo
->
aSttBlk
=
taosArrayInit
(
0
,
sizeof
(
SSttBlk
));
if
(
pBlockLoadInfo
->
aSttBlk
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_exit
;
}
code
=
tsdbReadSttBlk
(
pReader
,
iStt
,
pBlockLoadInfo
->
aSttBlk
);
code
=
tsdbReadSttBlk
(
pReader
,
iStt
,
pBlockLoadInfo
->
aSttBlk
);
if
(
code
)
{
if
(
code
)
{
goto
_exit
;
goto
_exit
;
}
}
}
}
code
=
tsdbReadSttBlk
(
pReader
,
iStt
,
pBlockLoadInfo
->
aSttBlk
);
if
(
code
)
{
goto
_exit
;
}
size_t
size
=
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
);
size_t
size
=
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
);
// find the start block
// find the start block
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录