Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
34036b93
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看板
提交
34036b93
编写于
2月 13, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix error in windows.
上级
f4a17d16
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
9 deletion
+11
-9
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+11
-9
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
34036b93
...
...
@@ -329,7 +329,7 @@ static int32_t uidComparFunc(const void* p1, const void* p2) {
// NOTE: speedup the whole processing by preparing the buffer for STableBlockScanInfo in batch model
static
SHashObj
*
createDataBlockScanInfo
(
STsdbReader
*
pTsdbReader
,
SBlockInfoBuf
*
pBuf
,
const
STableKeyInfo
*
idList
,
int32_t
numOfTables
)
{
STableUidList
*
pUidList
,
int32_t
numOfTables
)
{
// allocate buffer in order to load data blocks from file
// todo use simple hash instead, optimize the memory consumption
SHashObj
*
pTableMap
=
...
...
@@ -341,19 +341,17 @@ static SHashObj* createDataBlockScanInfo(STsdbReader* pTsdbReader, SBlockInfoBuf
int64_t
st
=
taosGetTimestampUs
();
initBlockScanInfoBuf
(
pBuf
,
numOfTables
);
STableUidList
*
pOrderedCheckInfo
=
&
pTsdbReader
->
status
.
uidList
;
pOrderedCheckInfo
->
tableUidList
=
taosMemoryMalloc
(
numOfTables
*
sizeof
(
uint64_t
));
if
(
pOrderedCheckInfo
->
tableUidList
==
NULL
)
{
pUidList
->
tableUidList
=
taosMemoryMalloc
(
numOfTables
*
sizeof
(
uint64_t
));
if
(
pUidList
->
tableUidList
==
NULL
)
{
return
NULL
;
}
p
OrderedCheckInfo
->
currentIndex
=
0
;
p
UidList
->
currentIndex
=
0
;
for
(
int32_t
j
=
0
;
j
<
numOfTables
;
++
j
)
{
STableBlockScanInfo
*
pScanInfo
=
getPosInBlockInfoBuf
(
pBuf
,
j
);
pScanInfo
->
uid
=
idList
[
j
].
uid
;
p
OrderedCheckInfo
->
tableUidList
[
j
]
=
idList
[
j
].
uid
;
p
UidList
->
tableUidList
[
j
]
=
idList
[
j
].
uid
;
if
(
ASCENDING_TRAVERSE
(
pTsdbReader
->
order
))
{
int64_t
skey
=
pTsdbReader
->
window
.
skey
;
...
...
@@ -368,7 +366,7 @@ static SHashObj* createDataBlockScanInfo(STsdbReader* pTsdbReader, SBlockInfoBuf
pScanInfo
->
lastKey
,
pTsdbReader
->
idStr
);
}
taosSort
(
p
OrderedCheckInfo
->
tableUidList
,
numOfTables
,
sizeof
(
uint64_t
),
uidComparFunc
);
taosSort
(
p
UidList
->
tableUidList
,
numOfTables
,
sizeof
(
uint64_t
),
uidComparFunc
);
pTsdbReader
->
cost
.
createScanInfoList
=
(
taosGetTimestampUs
()
-
st
)
/
1000
.
0
;
tsdbDebug
(
"%p create %d tables scan-info, size:%.2f Kb, elapsed time:%.2f ms, %s"
,
pTsdbReader
,
numOfTables
,
...
...
@@ -3891,7 +3889,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
}
STsdbReader
*
p
=
(
pReader
->
innerReader
[
0
]
!=
NULL
)
?
pReader
->
innerReader
[
0
]
:
pReader
;
pReader
->
status
.
pTableMap
=
createDataBlockScanInfo
(
p
,
&
pReader
->
blockInfoBuf
,
pTableList
,
numOfTables
);
pReader
->
status
.
pTableMap
=
createDataBlockScanInfo
(
p
,
&
pReader
->
blockInfoBuf
,
pTableList
,
&
pReader
->
status
.
uidList
,
numOfTables
);
if
(
pReader
->
status
.
pTableMap
==
NULL
)
{
*
ppReader
=
NULL
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -3916,12 +3914,14 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
// we need only one row
pPrevReader
->
capacity
=
1
;
pPrevReader
->
status
.
pTableMap
=
pReader
->
status
.
pTableMap
;
pPrevReader
->
status
.
uidList
=
pReader
->
status
.
uidList
;
pPrevReader
->
pSchema
=
pReader
->
pSchema
;
pPrevReader
->
pMemSchema
=
pReader
->
pMemSchema
;
pPrevReader
->
pReadSnap
=
pReader
->
pReadSnap
;
pNextReader
->
capacity
=
1
;
pNextReader
->
status
.
pTableMap
=
pReader
->
status
.
pTableMap
;
pNextReader
->
status
.
uidList
=
pReader
->
status
.
uidList
;
pNextReader
->
pSchema
=
pReader
->
pSchema
;
pNextReader
->
pMemSchema
=
pReader
->
pMemSchema
;
pNextReader
->
pReadSnap
=
pReader
->
pReadSnap
;
...
...
@@ -3952,6 +3952,7 @@ void tsdbReaderClose(STsdbReader* pReader) {
STsdbReader
*
p
=
pReader
->
innerReader
[
0
];
p
->
status
.
pTableMap
=
NULL
;
p
->
status
.
uidList
.
tableUidList
=
NULL
;
p
->
pReadSnap
=
NULL
;
p
->
pSchema
=
NULL
;
p
->
pMemSchema
=
NULL
;
...
...
@@ -3959,6 +3960,7 @@ void tsdbReaderClose(STsdbReader* pReader) {
p
=
pReader
->
innerReader
[
1
];
p
->
status
.
pTableMap
=
NULL
;
p
->
status
.
uidList
.
tableUidList
=
NULL
;
p
->
pReadSnap
=
NULL
;
p
->
pSchema
=
NULL
;
p
->
pMemSchema
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录