Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9de4bfb2
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看板
未验证
提交
9de4bfb2
编写于
11月 03, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
11月 03, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17834 from taosdata/fix/liao_cov
fix(query): update the lastkey for each table during table scanning.
上级
3a4101f7
fc20be86
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
9 deletion
+18
-9
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+1
-0
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+9
-7
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+7
-1
tests/system-test/1-insert/delete_data.py
tests/system-test/1-insert/delete_data.py
+1
-1
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
9de4bfb2
...
...
@@ -643,6 +643,7 @@ typedef struct SSttBlockLoadInfo {
STSchema
*
pSchema
;
int16_t
*
colIds
;
int32_t
numOfCols
;
bool
sttBlockLoaded
;
}
SSttBlockLoadInfo
;
typedef
struct
SMergeTree
{
...
...
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
浏览文件 @
9de4bfb2
...
...
@@ -72,6 +72,7 @@ void resetLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo) {
pLoadInfo
[
i
].
elapsedTime
=
0
;
pLoadInfo
[
i
].
loadBlocks
=
0
;
pLoadInfo
[
i
].
sttBlockLoaded
=
false
;
}
}
...
...
@@ -278,9 +279,10 @@ int32_t tLDataIterOpen(struct SLDataIter **pIter, SDataFReader *pReader, int32_t
(
*
pIter
)
->
pBlockLoadInfo
=
pBlockLoadInfo
;
size_t
size
=
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
);
if
(
size
==
0
)
{
//
size_t size = taosArrayGetSize(pBlockLoadInfo->aSttBlk);
if
(
!
pBlockLoadInfo
->
sttBlockLoaded
)
{
int64_t
st
=
taosGetTimestampUs
();
pBlockLoadInfo
->
sttBlockLoaded
=
true
;
code
=
tsdbReadSttBlk
(
pReader
,
iStt
,
pBlockLoadInfo
->
aSttBlk
);
if
(
code
)
{
...
...
@@ -288,7 +290,7 @@ int32_t tLDataIterOpen(struct SLDataIter **pIter, SDataFReader *pReader, int32_t
}
// only apply to the child tables, ordinary tables will not incur this filter procedure.
size
=
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
);
size
_t
size
=
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
);
if
(
size
>=
1
)
{
SSttBlk
*
pStart
=
taosArrayGet
(
pBlockLoadInfo
->
aSttBlk
,
0
);
...
...
@@ -296,10 +298,10 @@ int32_t tLDataIterOpen(struct SLDataIter **pIter, SDataFReader *pReader, int32_t
// all identical
if
(
pStart
->
suid
==
pEnd
->
suid
)
{
if
(
pStart
->
suid
==
suid
)
{
// do nothing
}
else
if
(
pStart
->
suid
!=
suid
)
{
if
(
pStart
->
suid
!=
suid
)
{
// no qualified stt block existed
taosArrayClear
(
pBlockLoadInfo
->
aSttBlk
);
(
*
pIter
)
->
iSttBlk
=
-
1
;
double
el
=
(
taosGetTimestampUs
()
-
st
)
/
1000
.
0
;
tsdbDebug
(
"load the last file info completed, elapsed time:%.2fms, %s"
,
el
,
idStr
);
...
...
@@ -330,7 +332,7 @@ int32_t tLDataIterOpen(struct SLDataIter **pIter, SDataFReader *pReader, int32_t
tsdbDebug
(
"load the last file info completed, elapsed time:%.2fms, %s"
,
el
,
idStr
);
}
size
=
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
);
size
_t
size
=
taosArrayGetSize
(
pBlockLoadInfo
->
aSttBlk
);
// find the start block
(
*
pIter
)
->
iSttBlk
=
binarySearchForStartBlock
(
pBlockLoadInfo
->
aSttBlk
->
pData
,
size
,
uid
,
backward
);
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
9de4bfb2
...
...
@@ -2186,7 +2186,7 @@ static bool isValidFileBlockRow(SBlockData* pBlockData, SFileBlockDumpInfo* pDum
static
bool
initLastBlockReader
(
SLastBlockReader
*
pLBlockReader
,
STableBlockScanInfo
*
pScanInfo
,
STsdbReader
*
pReader
)
{
// the last block reader has been initialized for this table.
if
(
pLBlockReader
->
uid
==
pScanInfo
->
uid
)
{
return
true
;
return
hasDataInLastBlock
(
pLBlockReader
)
;
}
if
(
pLBlockReader
->
uid
!=
0
)
{
...
...
@@ -2319,6 +2319,9 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) {
if
(
pReader
->
order
==
TSDB_ORDER_ASC
||
(
pReader
->
order
==
TSDB_ORDER_DESC
&&
(
!
hasDataInLastBlock
(
pLastBlockReader
))))
{
copyBlockDataToSDataBlock
(
pReader
,
pBlockScanInfo
);
// record the last key value
pBlockScanInfo
->
lastKey
=
ASCENDING_TRAVERSE
(
pReader
->
order
)
?
pBlock
->
maxKey
.
ts
:
pBlock
->
minKey
.
ts
;
goto
_end
;
}
}
...
...
@@ -2710,6 +2713,9 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
pInfo
->
window
=
(
STimeWindow
){.
skey
=
pBlock
->
minKey
.
ts
,
.
ekey
=
pBlock
->
maxKey
.
ts
};
setComposedBlockFlag
(
pReader
,
false
);
setBlockAllDumped
(
&
pStatus
->
fBlockDumpInfo
,
pBlock
->
maxKey
.
ts
,
pReader
->
order
);
// update the last key for the corresponding table
pScanInfo
->
lastKey
=
ASCENDING_TRAVERSE
(
pReader
->
order
)
?
pInfo
->
window
.
ekey
:
pInfo
->
window
.
skey
;
}
}
...
...
tests/system-test/1-insert/delete_data.py
浏览文件 @
9de4bfb2
...
...
@@ -25,7 +25,7 @@ from util.sqlset import TDSetSql
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
()
,
True
)
self
.
dbname
=
'db_test'
self
.
setsql
=
TDSetSql
()
self
.
stbname
=
'stb'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录