Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
74a5a231
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
74a5a231
编写于
7月 23, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]add some logs.
上级
057e8089
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
10 addition
and
11 deletion
+10
-11
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+10
-11
未找到文件。
src/tsdb/src/tsdbRead.c
浏览文件 @
74a5a231
...
...
@@ -622,7 +622,7 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo
.uid = (_checkInfo)->tableId.uid})
static
bool
doLoadFileDataBlock
(
STsdbQueryHandle
*
pQueryHandle
,
SCompBlock
*
pBlock
,
STableCheckInfo
*
pCheckInfo
)
{
static
bool
doLoadFileDataBlock
(
STsdbQueryHandle
*
pQueryHandle
,
SCompBlock
*
pBlock
,
STableCheckInfo
*
pCheckInfo
,
int32_t
slotIndex
)
{
STsdbRepo
*
pRepo
=
pQueryHandle
->
pTsdb
;
bool
blockLoaded
=
false
;
int64_t
st
=
taosGetTimestampUs
();
...
...
@@ -657,8 +657,8 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo
int64_t
elapsedTime
=
(
taosGetTimestampUs
()
-
st
);
pQueryHandle
->
cost
.
blockLoadTime
+=
elapsedTime
;
tsdbDebug
(
"%p load file block into buffer,
brange:%"
PRId64
"-%"
PRId64
" , rows:%d, elapsed time:%"
PRId64
" us
"
,
pQueryHandle
,
pBlock
->
keyFirst
,
pBlock
->
keyLast
,
pBlock
->
numOfRows
,
elapsedTime
);
tsdbDebug
(
"%p load file block into buffer,
index:%d, brange:%"
PRId64
"-%"
PRId64
" , rows:%d, elapsed time:%"
PRId64
" us, %p
"
,
pQueryHandle
,
slotIndex
,
pBlock
->
keyFirst
,
pBlock
->
keyLast
,
pBlock
->
numOfRows
,
elapsedTime
,
pQueryHandle
->
qinfo
);
return
blockLoaded
;
}
...
...
@@ -681,8 +681,7 @@ static void handleDataMergeIfNeeded(STsdbQueryHandle* pQueryHandle, SCompBlock*
// do not load file block into buffer
int32_t
step
=
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
?
1
:
-
1
;
cur
->
rows
=
tsdbReadRowsFromCache
(
pCheckInfo
,
binfo
.
window
.
skey
-
step
,
pQueryHandle
->
outputCapacity
,
&
cur
->
win
,
pQueryHandle
);
cur
->
rows
=
tsdbReadRowsFromCache
(
pCheckInfo
,
binfo
.
window
.
skey
-
step
,
pQueryHandle
->
outputCapacity
,
&
cur
->
win
,
pQueryHandle
);
pQueryHandle
->
realNumOfRows
=
cur
->
rows
;
// update the last key value
...
...
@@ -696,7 +695,7 @@ static void handleDataMergeIfNeeded(STsdbQueryHandle* pQueryHandle, SCompBlock*
return
;
}
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
);
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
,
cur
->
slot
);
doMergeTwoLevelData
(
pQueryHandle
,
pCheckInfo
,
pBlock
);
}
else
{
/*
...
...
@@ -723,7 +722,7 @@ static bool loadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlock
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
// query ended in/started from current block
if
(
pQueryHandle
->
window
.
ekey
<
pBlock
->
keyLast
||
pCheckInfo
->
lastKey
>
pBlock
->
keyFirst
)
{
if
(
!
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
))
{
if
(
!
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
,
cur
->
slot
))
{
return
false
;
}
...
...
@@ -744,7 +743,7 @@ static bool loadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlock
}
}
else
{
//desc order, query ended in current block
if
(
pQueryHandle
->
window
.
ekey
>
pBlock
->
keyFirst
||
pCheckInfo
->
lastKey
<
pBlock
->
keyLast
)
{
if
(
!
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
))
{
if
(
!
doLoadFileDataBlock
(
pQueryHandle
,
pBlock
,
pCheckInfo
,
cur
->
slot
))
{
return
false
;
}
...
...
@@ -1859,8 +1858,8 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int
}
int64_t
elapsedTime
=
taosGetTimestampUs
()
-
st
;
tsdbDebug
(
"%p build data block from cache completed, elapsed time:%"
PRId64
" us, numOfRows:%d, numOfCols:%d"
,
pQueryHandle
,
elapsedTime
,
numOfRows
,
numOfCols
);
tsdbDebug
(
"%p build data block from cache completed, elapsed time:%"
PRId64
" us, numOfRows:%d, numOfCols:%d
, %p
"
,
pQueryHandle
,
elapsedTime
,
numOfRows
,
numOfCols
,
pQueryHandle
->
qinfo
);
return
numOfRows
;
}
...
...
@@ -1975,7 +1974,7 @@ SArray* tsdbRetrieveDataBlock(TsdbQueryHandleT* pQueryHandle, SArray* pIdList) {
return
pHandle
->
pColumns
;
}
else
{
// only load the file block
SCompBlock
*
pBlock
=
pBlockInfo
->
compBlock
;
doLoadFileDataBlock
(
pHandle
,
pBlock
,
pCheckInfo
);
doLoadFileDataBlock
(
pHandle
,
pBlock
,
pCheckInfo
,
pHandle
->
cur
.
slot
);
// todo refactor
int32_t
numOfRows
=
copyDataFromFileBlock
(
pHandle
,
pHandle
->
outputCapacity
,
0
,
0
,
pBlock
->
numOfRows
-
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录