Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7014f790
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看板
提交
7014f790
编写于
7月 10, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optmize table statistic info
上级
b3e7dd5a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
26 deletion
+1
-26
source/dnode/vnode/src/tsdb/tsdbSttFileRW.c
source/dnode/vnode/src/tsdb/tsdbSttFileRW.c
+0
-19
source/dnode/vnode/src/tsdb/tsdbUtil2.h
source/dnode/vnode/src/tsdb/tsdbUtil2.h
+1
-7
未找到文件。
source/dnode/vnode/src/tsdb/tsdbSttFileRW.c
浏览文件 @
7014f790
...
...
@@ -488,21 +488,10 @@ static int32_t tsdbSttFileDoWriteStatisBlock(SSttFileWriter *writer) {
.
suid
=
TARRAY2_LAST
(
writer
->
staticBlock
->
suid
),
.
uid
=
TARRAY2_LAST
(
writer
->
staticBlock
->
uid
),
},
.
minVer
=
TARRAY2_FIRST
(
writer
->
staticBlock
->
minVer
),
.
maxVer
=
TARRAY2_FIRST
(
writer
->
staticBlock
->
maxVer
),
.
numRec
=
STATIS_BLOCK_SIZE
(
writer
->
staticBlock
),
.
cmprAlg
=
writer
->
config
->
cmprAlg
,
}};
for
(
int32_t
i
=
1
;
i
<
STATIS_BLOCK_SIZE
(
writer
->
staticBlock
);
i
++
)
{
if
(
statisBlk
->
minVer
>
TARRAY2_GET
(
writer
->
staticBlock
->
minVer
,
i
))
{
statisBlk
->
minVer
=
TARRAY2_GET
(
writer
->
staticBlock
->
minVer
,
i
);
}
if
(
statisBlk
->
maxVer
<
TARRAY2_GET
(
writer
->
staticBlock
->
maxVer
,
i
))
{
statisBlk
->
maxVer
=
TARRAY2_GET
(
writer
->
staticBlock
->
maxVer
,
i
);
}
}
for
(
int32_t
i
=
0
;
i
<
STATIS_RECORD_NUM_ELEM
;
i
++
)
{
code
=
tsdbCmprData
((
uint8_t
*
)
TARRAY2_DATA
(
writer
->
staticBlock
->
dataArr
+
i
),
TARRAY2_DATA_LEN
(
&
writer
->
staticBlock
->
dataArr
[
i
]),
TSDB_DATA_TYPE_BIGINT
,
statisBlk
->
cmprAlg
,
...
...
@@ -889,8 +878,6 @@ int32_t tsdbSttFileWriteRow(SSttFileWriter *writer, SRowInfo *row) {
.
uid
=
row
->
uid
,
.
firstKey
=
key
->
ts
,
.
lastKey
=
key
->
ts
,
.
minVer
=
key
->
version
,
.
maxVer
=
key
->
version
,
.
count
=
1
,
};
code
=
tStatisBlockPut
(
writer
->
staticBlock
,
&
record
);
...
...
@@ -898,12 +885,6 @@ int32_t tsdbSttFileWriteRow(SSttFileWriter *writer, SRowInfo *row) {
}
else
{
ASSERT
(
key
->
ts
>=
TARRAY2_LAST
(
writer
->
staticBlock
->
lastKey
));
if
(
TARRAY2_LAST
(
writer
->
staticBlock
->
minVer
)
>
key
->
version
)
{
TARRAY2_LAST
(
writer
->
staticBlock
->
minVer
)
=
key
->
version
;
}
if
(
TARRAY2_LAST
(
writer
->
staticBlock
->
maxVer
)
<
key
->
version
)
{
TARRAY2_LAST
(
writer
->
staticBlock
->
maxVer
)
=
key
->
version
;
}
if
(
key
->
ts
>
TARRAY2_LAST
(
writer
->
staticBlock
->
lastKey
))
{
TARRAY2_LAST
(
writer
->
staticBlock
->
count
)
++
;
TARRAY2_LAST
(
writer
->
staticBlock
->
lastKey
)
=
key
->
ts
;
...
...
source/dnode/vnode/src/tsdb/tsdbUtil2.h
浏览文件 @
7014f790
...
...
@@ -70,7 +70,7 @@ int32_t tTombBlockGet(STombBlock *tombBlock, int32_t idx, STombRecord *record);
int32_t
tTombRecordCompare
(
const
STombRecord
*
record1
,
const
STombRecord
*
record2
);
// STbStatisRecord ----------
#define STATIS_RECORD_NUM_ELEM
7
#define STATIS_RECORD_NUM_ELEM
5
typedef
union
{
int64_t
dataArr
[
STATIS_RECORD_NUM_ELEM
];
struct
{
...
...
@@ -78,8 +78,6 @@ typedef union {
int64_t
uid
;
int64_t
firstKey
;
int64_t
lastKey
;
int64_t
minVer
;
int64_t
maxVer
;
int64_t
count
;
};
}
STbStatisRecord
;
...
...
@@ -91,8 +89,6 @@ typedef union {
TARRAY2
(
int64_t
)
uid
[
1
];
TARRAY2
(
int64_t
)
firstKey
[
1
];
TARRAY2
(
int64_t
)
lastKey
[
1
];
TARRAY2
(
int64_t
)
minVer
[
1
];
TARRAY2
(
int64_t
)
maxVer
[
1
];
TARRAY2
(
int64_t
)
count
[
1
];
};
}
STbStatisBlock
;
...
...
@@ -101,8 +97,6 @@ typedef struct {
SFDataPtr
dp
[
1
];
TABLEID
minTbid
;
TABLEID
maxTbid
;
int64_t
minVer
;
int64_t
maxVer
;
int32_t
numRec
;
int32_t
size
[
STATIS_RECORD_NUM_ELEM
];
int8_t
cmprAlg
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录